Search Results

Search found 6433 results on 258 pages for 'trouble shooting'.

Page 128/258 | < Previous Page | 124 125 126 127 128 129 130 131 132 133 134 135  | Next Page >

  • 8-direction path finding algorithm

    - by frinkz
    I'm having trouble finding the right pathfinding algorithm for some AI I'm working on. I have players on a pitch, moving around freely (not stuck to a grid), but they are confined to moving in 8 directions (N NE E etc.) I was working on using A*, and a graph for this. But I realised, every node on the graph is equally far apart, and all the edges have the same weight - since the pitch is rectangular. And the number of nodes is enormous (being a large pitch, with them able to move between 1 pixel and another) I figured there must be another algorithm, optimised for this sort of thing?

    Read the article

  • Erlang code explained

    - by dagda1
    Hi, I am having a bit of trouble getting my head around the following erlang code -module(threesix). -export([quicksort/1]). quicksort(Pivot, Left, Right, []=_Src) -> {Left, Pivot, Right}; quicksort(Pivot, Left, Right, [H|T]=_Src) when H < Pivot -> quicksort(Pivot, [H|Left], Right, T); quicksort(Pivot, Left, Right, [H|T]=_Src) -> quicksort(Pivot, Left, [H|Right], T). quicksort([]) -> []; quicksort([H|T]=_List) -> {Left, Pivot, Right} = quicksort(H, [], [], T), quicksort(Left) ++ [Pivot] ++ quicksort(Right). I am specifically talking about the use of _Src and _List in the parameters. Are these simply for documentation as I cannot see why they are used? Thanks Paul

    Read the article

  • combining two different htaccess methods into one

    - by Patrick
    Im having trouble getting this htaccess to work properly. This is my file as it stands RewriteEngine on RewriteBase / RewriteRule ^sam/$ animals.php [QSA] RewriteCond %{REQUEST_URI} !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)|(\.swf)|(\.xpi)|(\.ico)|(\.src)$ RewriteCond %{REQUEST_URI} ^(.*)$ RewriteRule (.*)$ get.php?code=$1 [L] When i use RewriteEngine on RewriteBase / RewriteRule ^sam/$ animals.php [QSA] or RewriteEngine on RewriteCond %{REQUEST_URI} !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)|(\.swf)|(\.xpi)|(\.ico)|(\.src)$ RewriteCond %{REQUEST_URI} ^(.*)$ RewriteRule (.*)$ get.php?code=$1 [L] independently, it works fine, but together neither work properly. Here is what im trying to do: Any requests sent to domain.com/sam/?whatever=dogs, will get sent to domain.com/animals.php?whatever=dogs Any requests sent as domain.com/whatever, will get sent to domain.com/get.php?code=whatever

    Read the article

  • Django foreign keys cascade deleting and "related_name" parameter (bug?)

    - by Wiseman
    In this topic I found a good way to prevent cascade deleting of relating objects, when it's not neccessary. class Factures(models.Model): idFacture = models.IntegerField(primary_key=True) idLettrage = models.ForeignKey('Lettrage', db_column='idLettrage', null=True, blank=True) class Paiements(models.Model): idPaiement = models.IntegerField(primary_key=True) idLettrage = models.ForeignKey('Lettrage', db_column='idLettrage', null=True, blank=True) class Lettrage(models.Model): idLettrage = models.IntegerField(primary_key=True) def delete(self): """Dettaches factures and paiements from current lettre before deleting""" self.factures_set.clear() self.paiements_set.clear() super(Lettrage, self).delete() But this method seems to fail when we are using ForeignKey field with "related_name" parameter. As it seems to me, "clear()" method works fine and saves the instance of "deassociated" object. But then, while deleting, django uses another memorized copy of this very object and since it's still associated with object we are trying to delete - whooooosh! ...bye-bye to relatives :) Database was arcitectured before me, and in somewhat odd way, so I can't escape these "related_names" in reasonable amount of time. Anybody heard about workaround for such a trouble?

    Read the article

  • Is it possible to do AJAX calls in a liquid template?

    - by Brian Armstrong
    I'm looking at the liquid templating language for Rails apps: http://wiki.github.com/tobi/liquid/ I'd like my users to also be able to make AJAX calls (just like the ones in rails for periodically_call_remote, observe_field, etc). Is this possible? Assuming the rails helpers can be added as filters, how will the user be able to modify what gets returned by the AJAX call? They cannot modify an rjs file on the server or anything like that. I suppose the AJAX call could return JSON (instead of rendered html) and then the javascript could use that to render something. But I'm having a little trouble envisioning how it would work exactly. If anyone can point me to an example of this or clarify it'd be much appreciated. Thanks!

    Read the article

  • List of programming related conferences, unConference and meet-ups in the UK?

    - by Daniel Vaughan
    I really enjoy attending unconference/BarCamp type events and getting to meet developers, designers etc. from different backgrounds and sharing ideas in person. However, I have trouble finding events as there does not seem to be one place where they are listed. Does anyone know of such a place? I also want to setup a Google Technology User Group in Bristol but again other that putting it on Linkedin, Facebook, Meetup.com etc. I don't really know how to get the information out to what would essentially be a niche group of developers. Any ideas?

    Read the article

  • Passing unknown classes to String Streams in C++

    - by Sqeaky
    I am using a template function and I am passing and I may be sending instances of a variety of classes to a string stream. What can I do to make sure this continues to work? Let me be more specific where do I define the behavior for this? Is there some member that should be on each class being sent to the string stream, should I in some enhance or extend the existing String stream (I was thinking building a class that inherits from sstream and overloads the << operator to handle all the possible classes)? I had trouble even finding documentation on this, so even links to more resources would be helpful.

    Read the article

  • Subsonic custom mapping of objects to tables

    - by codekaizen
    Geeting, I'm using Compact Framework 3.5 and have tenatively settled on a custom build of Subsonic 3.0 to do data access. The trouble is that I am used to developing model-first but am also interested in keeping control of my DB schema. Therefore, neither ActiveRecord or Repository appears to meet my needs, and I want to use my existing POCO model and map it to my existing tables. I'm used to doing this via NHibernate and Entity Framework. After some investigation, it appears that I might be able to author a custom QueryMapping to give me the custom mapping I want. Before I start down this path, however, I'd like to see some kind of example of this being done. I can't seem to find any on the web, and wonder if anyone could give input on experience with Subsonic, model-first and a custom Table-per-Type and Table-per-Hierarchy mapping.

    Read the article

  • Is my approach correct to replicate this form with Reportlab?

    - by Wes
    I need to generate the form seen here using Python/reportlab. http://www.flickr.com/photos/49740282@N06/4563137758/sizes/o/ I am attempting to do this by creating a custom flowable for the header at the top (with the boxes drawn) and then having a table flowable for the jewelry table below. What shows as the JEWELRY table for this example could potentially be multiple tables. I am having trouble getting my drawn header to "flow". It gets drawn, but then my table data overlays it instead of appearing below it. This is my first project with reportlab. Before I really get into debugging this, I would like to know from someone with reportlab experience if my approach is correct here. Thanks!

    Read the article

  • Using OpenGL drawing operations in an object-oriented setting?

    - by Lion Kabob
    I've been plowing through basic shaders and whatnot for an application I'm writing, and I've been having trouble figuring out a high-level organization for the drawing calls. I'm thinking of having a singleton class which implements a number of basic drawing operations, taking data from "user" classes and passing that to the appropriate opengl calls. I'm wondering how people do this when writing their own applications, as the internet is chock full of basic "Your first shader" tutorials, but very little on suggested organization of drawing code. My particular environment is targeted at iPad/OpenGL ES 2.0, but I think the question stands for most environments.

    Read the article

  • Better type safety in Java collections

    - by Paul Tomblin
    In my java coding, I often end up with several Map<String,Map<String,foo>> or Map<String,List<String>> and then I have trouble remembering which String is which key. I comment the declaration with //Map<capabiltyId,Map<groupId,foo>> or //Map<groupId,List<capabilityId>, but it's not the greatest solution. If String wasn't final, I would make new classes CapabilityId extends String and GroupId extends String, but I can't. Is there a better way to keep track of which thing is the key and maybe have the compiler enforce it?

    Read the article

  • Passing an instantiated class to concrete class derived by Castle Windsor

    - by Tr1stan
    I have a system that I'm using to test some new architecture. I have the following setup (In MVC2 .Net - C Sharp): View < Controller < Service < Repository < DB I'm using Castle Windsor as my DI (IoC) controller, and this is working just fine in both the Service and Repo layers. However, I'm now at a point where I would like to pass an Entity Framework (DatabaseNameEntity) to the constructor to the Service, and then to the Repo, so that I have something similar to a Unit of Work pattern per request (This feels like what I'm trying to achieve anyway) - and I'm having trouble working out how this can be done using Castle Windsor. Am I going off on a silly tangent? Any pointers appreciated.

    Read the article

  • What are the "Navigation Properties" in this data model for?

    - by d03boy
    I've been wondering how to properly set up many-to-many relationships in ASP.NET MVC 2 using Linq2Sql for quite some time now. I found this blog post that seems to have a similar model layout as mine. If you take a look at the first screenshot showing the data model you can see that each model has "Navigation Properties" at the bottom of it. What exactly is this and why don't my models have them? I have the proper foreign keys put in to place. Most specifically, I am looking at the relationship between the Article and Category models since that is the only many-to-many relationship that I see and that's what I'm trying to model. Obviously I use an intermediary joining table between these two tables but I am having trouble understanding the proper methodology for modeling that relationship and I'm not finding this information anywhere on The Google.

    Read the article

  • How do I delete a foreign key in SQLAlchemy?

    - by Travis
    I'm using SQLAlchemy Migrate to keep track of database changes and I'm running into an issue with removing a foreign key. I have two tables, t_new is a new table, and t_exists is an existing table. I need to add t_new, then add a foreign key to t_exists. Then I need to be able to reverse the operation (which is where I'm having trouble). t_new = sa.Table("new", meta.metadata, sa.Column("new_id", sa.types.Integer, primary_key=True) ) t_exists = sa.Table("exists", meta.metadata, sa.Column("exists_id", sa.types.Integer, primary_key=True), sa.Column( "new_id", sa.types.Integer, sa.ForeignKey("new.new_id", onupdate="CASCADE", ondelete="CASCADE"), nullable=False ) ) This works fine: t_new.create() t_exists.c.new_id.create() But this does not: t_exists.c.new_id.drop() t_new.drop() Trying to drop the foreign key column gives an error: 1025, "Error on rename of '.\my_db_name\#sql-1b0_2e6' to '.\my_db_name\exists' (errno: 150)" If I do this with raw SQL, i can remove the foreign key manually then remove the column, but I haven't been able to figure out how to remove the foreign key with SQLAlchemy? How can I remove the foreign key, and then the column?

    Read the article

  • Which is the best alternative for Java Serialization?

    - by Alotor
    I'm currently working on a project which needs to persist any kind of objects (of which implementation we don't have any control) so these objects could be recovered afterwards. We can't implement a ORM because we can't restrict the users of our library at development time. Our first alternative was to serialize it with the Java default serialization but we had a lot of trouble recovering the objects when the users started to pass different versions of the same object (attributes changed types, names, ...). We have tried with the XMLEncoder class (transforms an object into a XML), but we have found that there is a lack of functionality (doesn't support Enums for example). Finally, we also tried JAXB but this impose our users to annotate their classes. Any good alternative?

    Read the article

  • Why should I use MVVM when it breaks built in riaservices functionality

    - by Jakob
    I'm struggling to grasp why MVVM is really a good pattern to implement in riaserivces, To me there's nothing but trouble to it, it just add's another tier that I have to code. I Get that I could change the UI, but really I don't need to. Instead i won't be able to user out of the box functionality with riaservices, datagrid, dataform all controls require some implementation. Why can't it just be simple? Is there really no way to get MVVM to automatically set "IsBusy" and all the dataform edit functionality. It's like reinventing the wheel to me, and it seems that I'd be able to write code much faster just using riaservices

    Read the article

  • C# Operator Overloading post-fix increment

    - by Victor
    I'm coding a date class and am having trouble with the post-fix increment (the prefix increment seems fine). Here is the sample code: public class date { int year, month, day; public date(int d, int m, int y) { day = d; month = m; year = y; } static public date operator ++(date d) { return d.Next(d); } } The method "Next(date d)" takes a date and returns tomorrows date (I left it out for brevity). I'm to young in C# to understand why the prefix is fine but postfix increment does nothing. But remember in C++ we would have to have two methods instead of just one - for prefix and postfix increments. Also no errors or warnings on compile.

    Read the article

  • using array_sum() in a while loop

    - by m477
    Hi folks, I'm learning PHP. Having trouble understanding why this piece of code isn't working. In particular: why is the result of array_sum($x) (1596) greater than $cap? Perhaps I'm not understanding the nature of while loops, but it seems to me (looking at a print_r($x)), the loop should cut out a step before it actually does. <?php function fibonacci_sum($cap = 1000){ list( $cur, $nxt, $seq ) = array( 0, 1, array() ); while ( array_sum($seq) < $cap ) { $seq[] = $cur; $add = $cur + $nxt; $cur = $nxt; $nxt = $add; } return $seq; } $x = fibonacci_sum(); echo array_sum($x); ?> Any insight is appreciated. Best, matt

    Read the article

  • Converting "is null" into a linq to sql statement

    - by Darryl Braaten
    I am having trouble replicating the following sql as a LINQ statement select TableA.* from TableA left outer join TableAinTableB on TableA.Id = TableAId where TableBId is null The following returns no lines from TableA in db.TableA join AinB in db.TableAinTableB on TableA.Id equals TableAId where AinB.TableBId == null select TableA Also tried and a few other things that didn't work. from TableA in db.TableA join AinB in db.TableAinTableB on TableA.Id equals TableAId where AinB == null select TableA TableAinTableB is a many to many table. The query I want will pull all the records from TableA that have no records in the middle table. My sql does what I want but I have no idea how to convert it to LINQ to SQL. I ended up working around it by just doing a db.ExecuteQuery("working sql"); But I would like to know if the query is possible in LINQ and how to write it, or a pointer to a document that covers this scenario. My searching did not uncover anything I found useful.

    Read the article

  • (iPhone SDK) How to link instance variables to a specific UILabel

    - by Timbo
    I'm using the iPhone SDK to build a simple application. I've created a brand new class which has a single variable. I need to make 5 instances of that class, which I have no trouble doing. I can create those instances and also set the variables without issue. What i do need to know is this: How do I link each of the 5 different instances of the variable to different and specific UILabels? Would I be better to create a method that dynamically creates and positions the labels? Thanks for your help in advance, I'm now to this iphone programming thing. I'm serious about learning fast though so I have posted a bounty on this question here : http://www.askearn.com/Responses.aspx?QuestionID=6542613f-7be8-4bb3-a950-aac218d47711

    Read the article

  • iphone app crashing when url connection connection timed out is coming

    - by satyam
    I'm creating iphone app. In that, when the app starts, it connects to server and downloads few images and then proceeds with app. When app is downloading, it will show the initial splash screen. as long as my server is able to ping my iphone, its working well. but the trouble starts when my server is taking much time to respond for the NSURL request. The app is crashing with following error: Mon May 14 13:56:34 unknown Springboard[24] <Warning>: com.xxxx.xxx failed to launch in time I understood that when such issues happen with application, iphone crashes the appliation. I would like to know how much max time iphone allows app to respond to such instances. Is there any max value for that?

    Read the article

  • Simple MySQL Query taking 45 seconds (Gets a record and its "latest" child record)

    - by Brian Lacy
    I have a query which gets a customer and the latest transaction for that customer. Currently this query takes over 45 seconds for 1000 records. This is especially problematic because the script itself may need to be executed as frequently as once per minute! I believe using subqueries may be the answer, but I've had trouble constructing it to actually give me the results I need. SELECT customer.CustID, customer.leadid, customer.Email, customer.FirstName, customer.LastName, transaction.*, MAX(transaction.TransDate) AS LastTransDate FROM customer INNER JOIN transaction ON transaction.CustID = customer.CustID WHERE customer.Email = '".$email."' GROUP BY customer.CustID ORDER BY LastTransDate LIMIT 1000 I really need to get this figured out ASAP. Any help would be greatly appreciated!

    Read the article

  • Tree item edit event listener in flex

    - by Biroka
    I want to catch itemEditEnd in a tree control, but i'm having a little trouble. I call the item editing a bit different: <mx:Tree id="tree" width="100%" height="100%" itemDoubleClick="treeProjects_itemDoubleClickHandler(event)" doubleClickEnabled="true" editable="true" itemEditBeginning="treeProjects_itemEditBeginingHandler(event)" itemEditEnd="treeProjects_itemEditEndHandler(event)" > but: protected function treeProjects_itemEditBeginingHandler(event:ListEvent):void { event.preventDefault(); } i do this, because I want to edit the field just when clicking rename in the context menu. And when I click rename in the context menu, this is what i'm doing (contextParentItem is the event catched on itemRollOver in the tree) : Tree( contextParentItem.target ).editedItemPosition = { columnIndex: 0, rowIndex: contextParentItem.rowIndex }; Thisway I can't catch the itemEditEnd event, but I want to handle some stuff, like: if the new entered value is an empty string, then I don't want to accept the new value if I hit ESC then, the old value should remain.

    Read the article

  • Mac OS X pygame input goes to Terminal instead of Python

    - by Parappa
    I'm having trouble running a pygame based app on Mac OS X via Terminal. Input events such as keystrokes go to the Terminal instead of my Python app, and are detected by pygame. For example, I have the following test script: import pygame pygame.init() screen = pygame.display.set_mode((640, 480)) done = False while not done: pygame.event.pump() keys = pygame.key.get_pressed() if keys[pygame.K_ESCAPE]: done = True if keys[pygame.K_SPACE]: print "got here" Neither K_ESCAPE nor K_SPACE will be handled by this script when I run it from a Mac OS X Terminal, but Terminal will echo back the spaces. I'm running the MacPorts port of pygame (py-game), which depends on Python 2.4, and I've also used python_select to make python24 the active version.

    Read the article

  • using a texture mesh and wireframe mesh in threejs

    - by Andy Poes
    I'm trying to draw a wireframe mesh and a textured mesh in threeJS but when I have both added to my scene the textured mesh doesn't display. Code below: I'm having trouble creating two meshes that share the same geometry where one of the materials is wireframe and the other is a texture. If one of the materials is wireframe and the other is just a color fill it works fine- but as soon as I make the second material a texture it stops working. If I comment out scene.add( wireMesh ); then the textured mesh shows up. var wireMat = new THREE.MeshBasicMaterial( { color:0x00FFFF, wireframe: true, transparent: true, overdraw:true } ); var wireMesh = new THREE.Mesh(geometry, wireMat); scene.add( wireMesh ); var texture = texture = THREE.ImageUtils.loadTexture( 'textures/world.jpg' ); var imageMat = new THREE.MeshBasicMaterial( {color:0xffffff, map: texture } ); var fillMesh = new THREE.Mesh(geometry, imageMat); scene.add( fillMesh );

    Read the article

< Previous Page | 124 125 126 127 128 129 130 131 132 133 134 135  | Next Page >