Search Results

Search found 11857 results on 475 pages for 'navigation properties'.

Page 21/475 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • A* navigational mesh path finding

    - by theguywholikeslinux
    So I've been making this top down 2D java game in this framework called Greenfoot [1] and I've been working on the AI for the guys you are gonna fight. I want them to be able to move around the world realistically so I soon realized, amongst a couple of other things, I would need some kind of pathfinding. I have made two A* prototypes. One is grid based and then I made one that works with waypoints so now I need to work out a way to get from a 2d "map" of the obstacles/buildings to a graph of nodes that I can make a path from. The actual pathfinding seems fine, just my open and closed lists could use a more efficient data structure, but I'll get to that if and when I need to. I intend to use a navigational mesh for all the reasons out lined in this post on ai-blog.net [2]. However, the problem I have faced is that what A* thinks is the shortest path from the polygon centres/edges is not necessarily the shortest path if you travel through any part of the node. To get a better idea you can see the question I asked on stackoverflow [3]. I got a good answer concerning a visibility graph. I have since purchased the book (Computational Geometry: Algorithms and Applications [4]) and read further into the topic, however I am still in favour of a navigational mesh (See "Managing Complexity" [5] from Amit’s Notes about Path-Finding [6]). (As a side note, maybe I could possibly use Theta* to convert multiple waypoints into one straight line if the first and last are not obscured. Or each time I move back check to the waypoint before last to see if I can go straight from that to this) So basically what I want is a navigational mesh where once I have put it through a funnel algorithm (e.g. this one from Digesting Duck [7]) I will get the true shortest path, rather than get one that is the shortest path following node to node only, but not the actual shortest given that you can go through some polygons and skip nodes/edges. Oh and I also want to know how you suggest storing the information concerning the polygons. For the waypoint prototype example I made I just had each node as an object and stored a list of all the other nodes you could travel to from that node, I'm guessing that won't work with polygons? and how to I tell if a polygon is open/traversable or if it is a solid object? How do I store which nodes make up the polygon? Finally, for the record: I do want to programme this by myself from scratch even though there are already other solutions available and I don't intend to be (re) using this code in anything other than this game so it does not matter that it will inevitably be poor quality. http://greenfoot.org http://www.ai-blog.net/archives/000152.html http://stackoverflow.com/q/7585515/ http://www.cs.uu.nl/geobook/ http://theory.stanford.edu/~amitp/GameProgramming/MapRepresentations.html http://theory.stanford.edu/~amitp/GameProgramming/ http://digestingduck.blogspot.com/2010/03/simple-stupid-funnel-algorithm.html

    Read the article

  • OCS 2007 R2 User Properties Error Message

    - by BWCA
    When I attempted to configure one of our user’s Meeting settings using the Microsoft Office Communications Server 2007 R2 Administration Tool   I received an Validation failed – Validation failed with HRESULT = 0XC3EC7E02 dialog box error message. I received the same error message when I tried to configure the user’s Telephony and Other settings. Using ADSI Edit, I compared the settings of an user that I had no problems configuring and the user that I had problems configuring.  For the user I had problems configuring, I noticed a trailing space after the last phone number digit for the user’s msRTCSIP-Line attribute. After I removed the trailing space for the attribute and waited for Active Directory replication to complete, I was able to configure the user’s Meeting settings (and Telephony/Other settings) without any problems. If you get the error message, check your user’s msRTCSIP-xxxxx attributes in Active Directory using ADSI Edit for any trailing spaces, typos, or any other mistakes.

    Read the article

  • Making an AI walk on a NavigationMesh (2D/Top-Down game)

    - by Lennard Fonteijn
    For some time I have been working on a framework which should make it possible to generate 2D levels based on a set of rules specified by level designers. You can read more about it here as I won't go into details: http://www.jorisdormans.nl/article.php?ref=engineering_emergence Anyway, I'm now at the point of putting the framework to use and have trouble coming up with a solution for AI. I decided to implement a NavigationMesh in the generated levels as I already have that information to start with. Consider the following image (borrowed from http://www.david-gouveia.com/pathfinding-on-a-2d-polygonal-map/): When I run A* on the NavigationMesh, the red path would be suggested when I want to go from point A to B (either direction). However, I don't want my AI to walk that path directly and clipping corners, I'd rather want them to follow the more logical black path. How would I go about going from the Red path to the Black path, are there any algorithms for this. Which steps do I take? Is A* the proper solution for this at all? For some additional information: The proof-of-concept game is a 2D top-down game written in C#, but examples/references in any language are welcome!

    Read the article

  • .NET Properties - Use Private Set or ReadOnly Property?

    - by tgxiii
    In what situation should I use a Private Set on a property versus making it a ReadOnly property? Take into consideration the two very simplistic examples below. First example: Public Class Person Private _name As String Public Property Name As String Get Return _name End Get Private Set(ByVal value As String) _name = value End Set End Property Public Sub WorkOnName() Dim txtInfo As TextInfo = _ Threading.Thread.CurrentThread.CurrentCulture.TextInfo Me.Name = txtInfo.ToTitleCase(Me.Name) End Sub End Class // ---------- public class Person { private string _name; public string Name { get { return _name; } private set { _name = value; } } public void WorkOnName() { TextInfo txtInfo = System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo; this.Name = txtInfo.ToTitleCase(this.Name); } } Second example: Public Class AnotherPerson Private _name As String Public ReadOnly Property Name As String Get Return _name End Get End Property Public Sub WorkOnName() Dim txtInfo As TextInfo = _ Threading.Thread.CurrentThread.CurrentCulture.TextInfo _name = txtInfo.ToTitleCase(_name) End Sub End Class // --------------- public class AnotherPerson { private string _name; public string Name { get { return _name; } } public void WorkOnName() { TextInfo txtInfo = System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo; _name = txtInfo.ToTitleCase(_name); } } They both yield the same results. Is this a situation where there's no right and wrong, and it's just a matter of preference?

    Read the article

  • WPF properties memory management

    - by mrpyo
    I'm trying to build binding system similar to the one that is used in WPF and I ran into some memory leaking problems, so here comes my question - how is memory managed in WPF property system? From what I know in WPF values of DependencyProperties are stored in external containers - what I wanna know is how are they collected when DependencyObject dies? Simplest solution would be to store them is some weak reference dictionary - but here comes the main problem I ran into - when there is a listener on property that needs reference to its (this property) parent it holds it (the parent) alive (when value of weak reference dictionary points somewhere, even indirectly, to key - it can't be collected). How is it avoided in WPF without the need of using weak references everywhere?

    Read the article

  • Basic Form Properties and Modality in VB.NET

    Creating your First VB.NET Form 1. Launch Microsoft Visual Basic 2008 Express Edition. If you do not have this program, then you cannot create VB.NET forms. You can read an introductory tutorial on how to install Visual Basic on your computer: http://www.aspfree.com/c/a/VB.NET/Visual-Basic-for-Beginners/ 2. Go to File - gt; New Project. 3. Since you will be creating a form, select Windows Forms Application. 4. Select a name for your form project, e.g. MyFirstForm. 5. Hit OK to get started. 6. You will then see an empty form -- just like an empty canvas when you paint. It looks like th...

    Read the article

  • how to select categories for user generated content site?

    - by Frederik Creemers
    On the site I'm building, users can create tutorials. I want the users to be able to create tutorials on as many subjects as possible, but still have some preset categories. What's the best way to select these categories? The reason I don't just let users add keywords, and use these for categorization, is because users gain experience points in a certain subject when their tutorial is liked by someone, and in a similar way the Stack Exchange network does, create communities around these subjects. I will give visiters the possibility to suggest new categories. here are the categories that I'm thinking of at the moment: health gardening cooking technology science & math music visual art

    Read the article

  • Put a link on the nav bar in Wordpress

    - by Rafe Kettler
    I have a Wordpress blog. On the same domain, I have some other stuff hosted that isn't part of my WP install. I want to link to those other places on my domain from the top menu bar (nav bar) on my blog. How can I do that? The theme is Lightword, relevant header.php code follows: <body <?php body_class(); ?>> <div id="wrapper"> <?php lightword_header_image(); ?> <div id="header"> <?php lightword_rss_feed(); ?> <div id="top_bar"> <div class="center_menu"> <ul id="front_menu" <?php global $lw_remove_searchbox, $lw_use_wp_menus; $lw_menu_width = ""; if($lw_remove_searchbox == "true") $lw_menu_width = " class=\"expand\" "; echo $lw_menu_width; ?>> <?php echo lightword_homebtn(__('Home','lightword')); ?> <?php if ( function_exists('wp_nav_menu') && $lw_use_wp_menus != "true") { $lightword_menu = wp_nav_menu( array( 'menu' => 'lightword_top_menu', 'echo' => false, 'menu_id' => 'front_menu', 'container' => '', 'theme_location' => 'lightword_top_menu', 'link_before' => '<span>', 'link_after' => '</span>' ) ); $lightword_menu = preg_replace( array( '/^<ul id="front_menu" class="menu">/', '/\n<\/ul>$/' ), '', $lightword_menu); echo $lightword_menu; }else{ echo lightword_wp_list_pages(); } ?> </ul> </div> <?php echo lightword_searchbox(); ?> </div> </div> <div id="content">

    Read the article

  • How to load Image in C# and set properties of the Picture Box

    - by SAMIR BHOGAYTA
    Create a C# application drag a picture Box, four buttons and open file dialog on the form. Write code on btn_browse Button click ----------------------------------------- private void btn_browse_Click(object sender, System.EventArgs e) { try { OpenFileDialog open = new OpenFileDialog(); open.Filter = "Image Files(*.jpg; *.jpeg; *.gif; *.bmp)|*.jpg; *.jpeg; *.gif; *.bmp"; if (open.ShowDialog()==DialogResult.OK) { pictureBox1.Image = new Bitmap(open.FileName); } } catch (Exception) { throw new ApplicationException("Failed loading image"); } } Write code on btn_StretchImage Button click ------------------------------------------------ private void btn_StretchImage_Click(object sender, System.EventArgs e) { pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; } Write code on btn_AutoSize Button click ------------------------------------------------- private void btn_AutoSize_Click(object sender, System.EventArgs e) { pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; } Write code on btn_CenterImage Button click -------------------------------------------------- private void btn_CenterImage_Click(object sender, System.EventArgs e) { pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; }

    Read the article

  • Unit turning in navmesh-based pathfinding

    - by Haddayn
    I'm working on an RTS game, and I'm using navmeshes for unit pathfinding. I do know how to find a general path within a navmesh, but how do you determine if the unit have enough space to turn? I have units of different shapes (mostly rectangles with different dimensions), and with different turn radii. Additionally some of units can turn in place, and some can move in reverse. So, how to find a path which unit can follow, considering that it can not rotate easily?

    Read the article

  • Dependency Properties Made Easy

    ok so I found that for some reason I thought I did a post on this before and I couldn't find it. So I thought I would make a new post as simple as possible. Here is a simple dp:public readonly DependencyProperty ResistanceProperty = DependencyProperty.Register("Resistance", typeof(double), typeof(AnimatingPanelBase), null);public double Resistance{get{return (double)GetValue(ResistanceProperty);}set{SetValue(ResistanceProperty, value);}}Nice and simple right? why bother you ask, well the biggest...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Properties framework in java apps

    - by Roman
    Hi All I have been using spring for a while as my IOC. It has also a very nice way of injecting properties in your beans. Now I am participating in a new project where the IOC is Guice. I dont understand fully the concept how should I inject properties in to my beans using Guice. The question : Is it actually possible to inject raw properties ( strings , ints ) into my guice beans. If the answer is no , than maybe you know some nice Properties Framework for java. Because right now I wanted to use the ResourceBundle class for simple properties management in my app. But after using spring for a while this just dont seem seriously enought for me.

    Read the article

  • Can .NET load and parse a properties file equivalent to Java Properties class?

    - by Tai Squared
    Is there an easy way in C# to read a properties file that has each property on a separate line followed by an equals sign and the value, such as the following: ServerName=prod-srv1 Port=8888 CustomProperty=Any value In Java, the Properties class handles this parsing easily: Properties myProperties=new Properties(); FileInputStream fis = new FileInputStream (new File("CustomProps.properties")); myProperties.load(fis); System.out.println(myProperties.getProperty("ServerName")); System.out.println(myProperties.getProperty("CustomProperty")); I can easily load the file in C# and parse each line, but is there a built in way to easily get a property without having to parse out the key name and equals sign myself? The C# information I have found seems to always favor XML, but this is an existing file that I don't control and I would prefer to keep it in the existing format as it will require more time to get another team to change it to XML than parsing the existing file.

    Read the article

  • Why i can not acces the protected properties in my web application

    - by GigaPr
    Hi i have a web application which has a Base class in which i define all the properties common to the web pages. The base class extends System.Web.UI.Page Furthermore i have a Base User control class where are defined all the properties common to the user controls. the Base User Control extends System.Web.UI.UserControl all the properties in both base classes are protected. All the web pages extends the base class . All the controls extends the base user control class. The problem is i can not access the properties defined in the base class from the user controls and I can not extend two classes in the base user controls The question is how can i access the properties defined in the Base class from within the user controls? I hope i have been clear Thanks

    Read the article

  • How to access SharePoint web part properties?

    - by shannon.stewart
    I have created a feature for SharePoint 2007 that has a web part. I have added a custom property to the web part like so: [Personalizable(PersonalizationScope.Shared)] [WebBrowsable(true)] [Category("My Custom Properties")] [WebDisplayName("ServiceURL")] [WebDescription("The URL for the Wcf service")] public string ServiceURL { get; set; } Along with this web part, I've added a custom page that the web part will have a link to. I would like to reference the web part property from the custom page, but I don't know where these properties are stored. I've tried to access it using the code below, but both property collections don't have any properties stored. SPFeaturePropertyCollection spProperties = SPContext.Current.Site.Features[this.FeatureGuid].Properties; or SPFeaturePropertyCollection spProperties = SPContext.Current.Site.Features[this.FeatureGuid].Definition.Properties; My question is how can I get a reference to the web part property from other pages?

    Read the article

  • Remove unnecessary svn:mergeinfo properties

    - by LeonZandman
    When I merge stuff in my repository Subversion wants to add/change a lot of svn:mergeinfo properties to files that are totally unrelated to the things that I want to merge. Questions about this behaviour have been asked before here on Stackoverflow.com, as you can read here and here. From what I understand from the topics mentioned above it looks like a lot of files in my repository have explicit svn:mergeinfo properties on them, when they shouldn't. The advice is to reduce the amount and only put those properties on relevant files/folders. So now my question: how can I easily remove those unneeded properties? I'm using TortoiseSVN, but am reluctant to manually check/fix hundreds of files. Is there an easier way to remove those unnecessary svn:mergeinfo properties? P.S. I'm not looking for C++ SVN API code.

    Read the article

  • C#: Non-constructed generics as properties (eg. List<T>)

    - by Dav
    The Problem It's something I came across a while back and was able to work around it somehow. But now it came back, feeding on my curiosity - and I'd love to have a definite answer. Basically, I have a generic dgv BaseGridView<T> : DataGridView where T : class. Constructed types based on the BaseGridView (such as InvoiceGridView : BaseGridView<Invoice>) are later used in the application to display different business objects using the shared functionality provided by BaseGridView (like virtual mode, buttons, etc.). It now became necessary to create a user control that references those constructed types to control some of the shared functionality (eg. filtering) from BaseGridView. I was therefore hoping to create a public property on the user control that would enable me to attach it to any BaseGridView in Designer/code: public BaseGridView<T> MyGridView { get; set; }. The trouble is, it doesn't work :-) When compiled, I get the following message: The type or namespace name 'T' could not be found (are you missing a using directive or an assembly reference?) Solutions? I realise I could extract the shared functionality to an interface, mark BaseGridView as implementing that interface, and then refer to the created interface in my uesr control. But I'm curious if there exists some arcane C# command/syntax that would help me achieve what I want - without polluting my solution with an interface I don't really need :-)

    Read the article

  • Finding the attributes on the properties of an instance of a class

    - by Dan
    Given an instance of a class I want to set properties on attributes at runtime. So I tried this, but as far as I can tell this finds the attributes on the class not the instance, so any changes I make to the attribute properties have no effect. var properties = myObject.GetType().GetProperties(); foreach (object prop in properties) { var attribute =prop.GetCustomAttributes(typeof(MyAttribute), true)[0]; //attribute.MyProp do some stuff } If I try using type descriptor like below, there is no way of getting to the attributes on the properties. var myObject= (MyClass) object; PropertyDescriptorCollection props = TypeDescriptor.GetProperties(myObject); //There is no props[0].GetCustomAttributes(

    Read the article

  • What are the best practices for unit testing properties with code in the setter?

    - by nportelli
    I'm fairly new to unit testing and we are actually attempting to use it on a project. There is a property like this. public TimeSpan CountDown { get { return _countDown; } set { long fraction = value.Ticks % 10000000; value -= TimeSpan.FromTicks(fraction); if(fraction > 5000000) value += TimeSpan.FromSeconds(1); if(_countDown != value) { _countDown = value; NotifyChanged("CountDown"); } } } My test looks like this. [TestMethod] public void CountDownTest_GetSet_PropChangedShouldFire() { ManualRafflePresenter target = new ManualRafflePresenter(); bool fired = false; string name = null; target.PropertyChanged += new PropertyChangedEventHandler((o, a) => { fired = true; name = a.PropertyName; }); TimeSpan expected = new TimeSpan(0, 1, 25); TimeSpan actual; target.CountDown = expected; actual = target.CountDown; Assert.AreEqual(expected, actual); Assert.IsTrue(fired); Assert.AreEqual("CountDown", name); } The question is how do I test the code in the setter? Do I break it out into a method? If I do it would probably be private since no one else needs to use this. But they say not to test private methods. Do make a class if this is the only case? would two uses of this code make a class worthwhile? What is wrong with this code from a design standpoint. What is correct?

    Read the article

  • can I add properties to a typo3 extbase domain model object?

    - by The Newbie Qs
    I want to store a username in a coupon object, each coupon object already has the uid of the user who created it. I can loop over the coupon objects and read the associated usernames from fe_users but how then will I save those usernames into the coupons so when they are passed to the template the usernames can be read like so coupon.username, or in some other easy way so each username will appear on the page with the right coupon as they are all printed out in a table? If I was doing basic php instead of typo3 i would just define a query but what is the typo3 v4.5 way? My code so far - which dies on the line where I try to assign the new property --creatorname -- to the $coup object. public function listAction() { $coupons = $this->couponRepository->findAll(); // @var Tx_Extbase_Domain_Repository_FrontendUserRepository $userRepository */ $userRepository = $this->objectManager->get("Tx_Extbase_Domain_Repository_FrontendUserRepository"); foreach ($coupons as $coup) { echo '<br />test '.$coup->getCreator(); echo '<br />count = '.$userRepository->countAll().'<br />'; $newObject = $userRepository->findByUid( intval($coup->getCreator())); //var_dump($newObject); var_dump($coup); echo '<br />getUsername '.$newObject->getUsername() ; $coup['creatorname'] = $newObject->getUsername(); echo '<br />creatorname '.$coup['creatorname'] ; } $this->view->assign('coupons', $coupons); }

    Read the article

  • Which Java library lets me initialize an object's properties from a properties file?

    - by Kjetil Ødegaard
    Is there a Java library that lets you "deserialize" a properties file directly into an object instance? Example: say you have a file called init.properties: username=fisk password=frosk and a Java class with some properties: class Connection { private String username; private String password; public void setUsername(String username) { this.username = username; } public void setPassword(String password) { this.password = password; } } I want to do this: Connection c = MagicConfigurator.configure("init.properties", new Connection()) and have MagicConfigurator apply all the values from the properties file to the Connection instance. Is there a library with a class like this?

    Read the article

  • Keep Side Navigation Fixed with Scrolling of page

    - by Stuart Robson
    Hi Guys, I have a clients website - www.stagecraft.co.uk and they want the navigation on the hire pages (longer page) to still be there at when you scroll the page down. I've had a quick go (not live) with position fixed but in doing so it the leftside navigation is about 200px or so from the top of the window. Any when to get it at the top of the window when scrolling? Thanks in advance....

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >