Daily Archives

Articles indexed Thursday June 28 2012

Page 7/18 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Google keeps indexing /comment/reply URL

    - by jaypabs
    With the new update of Google algorithm called Penguin, I think my site was being penalized due to webspam. But of course I don't create post which seems to be spam to Google. It is just I think how Google index my site. I found out that Google index the URL of my site like: http://www.example.com/comment/reply/3866/26556 So there are so many comment/reply URL index by Google. I have already added: Disallow: /comment/reply/ Disallow: /?q=comment/reply/ but still Google still index this URL. Any idea how to prevent Google from indexing comments?

    Read the article

  • Is this masters course worth taking?

    - by dbomb101
    I've been spending the last couple of years developing 2D game in XNA but there are still alot of gaps in my knowledge especially in terms of 3D development and working in game development teams and I would like to eventually be able to develop more technically advanced games. I was thinking of taking the masters course linked below to help out with that. Do you think the course is worth it or should I simply continue self studying ? Course Details

    Read the article

  • How to synchronise the acceleration, velocity and position of the monsters on the server with the players?

    - by Nick
    I'm building an MMO using Node.js, and there are monsters roaming around. I can make them move around on the server using vector variables acceleration, velocity and position. acceleration = steeringForce / mass; velocity += acceleration * dTime; position += velocity * dTime; Right now I just send the positions over, and tell the players these are the "target positions" of the monsters, and let the monsters move towards the target positions on the client with a speed dependant on the distance of the target position. It works but looks rather strange. How do I synchronise these properly with the players without looking funny to them, taking into account the server lag? The problem is that I don't know how to make use of the correct acceleration/velocity values here; right now they just move directly in a straight line to the target position instead of accelerating/braking there properly. How can I implement such behaviour?

    Read the article

  • Panning with the OpenGL Camera / View Matrix

    - by Pris
    I'm gonna try this again I've been trying to setup a simple camera class with OpenGL but I'm completely lost and I've made zero progress creating anything useful. I'm using modern OpenGL and the glm library for matrix math. To get the most basic thing I can think of down, I'd like to pan an arbitrarily positioned camera around. That means move it along its own Up and Side axes. Here's a picture of a randomly positioned camera looking at an object: It should be clear what the Up (Green) and Side (Red) vectors on the camera are. Even though the picture shows otherwise, assume that the Model matrix is just the identity matrix. Here's what I do to try and get it to work: Step 1: Create my View/Camera matrix (going to refer to it as the View matrix from now on) using glm::lookAt(). Step 2: Capture mouse X and Y positions. Step 3: Create a translation matrix mapping changes in the X mouse position to the camera's Side vector, and mapping changes in the Y mouse position to the camera's Up vector. I get the Side vector from the first column of the View matrix. I get the Up vector from the second column of the View matrix. Step 4: Apply the translation: viewMatrix = glm::translate(viewMatrix,translationVector); But this doesn't work. I see that the mouse movement is mapped to some kind of perpendicular axes, but they're definitely not moving as you'd expect with respect to the camera. Could someone please explain what I'm doing wrong and point me in the right direction with this camera stuff?

    Read the article

  • Get all triangles that are < N dist from you?

    - by CyanPrime
    Does anyone know of a way I could add a radius to this code for p? Like basically saying "this is true if the triangle is < N dist from the point" public boolean isPointInTriangle( Vector3f p, Vector3f a, Vector3f b, Vector3f c ) { return ( pointsAreOnSameSide(p, a, b, c) && pointsAreOnSameSide(p, b, a, c) && pointsAreOnSameSide(p, c, a, b) ); } public boolean pointsAreOnSameSide( Vector3f p1, Vector3f p2, Vector3f a, Vector3f b ) { Vector3f diffba = new Vector3f(0,0,0); Vector3f.sub( b, a, diffba ); Vector3f diffp1a = new Vector3f(0,0,0); Vector3f.sub( p1, a, diffp1a ); Vector3f diffp2a = new Vector3f(0,0,0); Vector3f.sub( p2, a, diffp2a ); Vector3f cross1 = Vector3f.cross(diffba, diffp1a); Vector3f cross2 = Vector3f.cross(diffba, diffp2a); return ( Vector3f.dot( cross1, cross2 ) >= 0 ); }

    Read the article

  • What are some good examples of exuberant in-game instructions for telling the player to repeatedly smash a button?

    - by Michael
    What are some good examples of exuberant in-game instructions for telling the player to repeatedly and quickly press a button or perform an action? I'm especially interested in examples in retro games (e.g., from the NES, SNES, and 1980-90s arcade eras), and I would love to see examples with text, graphics, or both. To illustrate, here are a few examples of the type of instructions that I'm thinking of: Smash the A button to lift something heavy! Toggle the joystick back and forth to break free! Quickly press the button to build power in a meter! I'm working on a 2D iOS game with retro-style pixel art, and there's a point where I want the player to quickly tap on a sprite to complete an action. I have a serviceable starting point -- the word "TAP" flashing with an arrow repeatedly moving downward beneath it: But it still doesn't feel quite right. I would love to see some actual examples from the golden days of 2D gaming to use as reference material. I know examples abound, but I'm just struggling to think of any concrete ones at the moment. Can you think of any examples of this type of thing in old games?

    Read the article

  • Emacs - nxhtml-mode - memory full

    - by mbutz
    working with nxhtml-mode in emacs, I get problems since a few weeks. While working emacs pauses unexpectingly until showing a message in the mode line "!MEM FULL!"; obviously nxhtml-mode is filling up the memory until emacs stopps to work. I am working with html, php and css files. I have no idea how I could debug this problem in a meaningfull way. Also I seem to be the only one to have this problem, because googling did not deliver any answers to this question. I am using emacs 2.32 on an Linux Mint 11 system. I can not find out the verson of nxhtml, it says revision 829 downloaded from http://bazaar.launchpad.net/~nxhtml/nxhtml/main/revision/829. I set up a test scenario with a minimal dot-emacs just to test the nxhtml-mode. It seemed to be alright, but it does not reflect my productive set up. It would probably take a week or so to gradually include everything I used to use within emacs (e.g. org-mode) while testing whether nxhtml-mode does not like anything, which is called in my dot-emacs file. Is there another way? Can I find out, what causes the memory overload? Does anyone has similar problems using nxhtml-mode? Greetings Martin

    Read the article

  • Rails activerecord includes. How to access the included columns?

    - by Lee Quarella
    I my User has_many :event_patrons and EventPatron belongs_to :user. I would like to slap together the user with one specific event patron with something like this sql statement: SELECT * FROM `users` INNER JOIN `event_patrons` ON `event_patrons`.`user_id` = `users`.`id` WHERE `event_patrons`.`event_id` = 1 So in rails I tried this: User.all(:joins => :event_patrons, :condidions => {:event_patrons => {:event_id => 1}}) But that gives me SELECT users.* instead of SELECT *: SELECT `users`* FROM `users` INNER JOIN `event_patrons` ON `event_patrons`.`user_id` = `users`.`id` WHERE `event_patrons`.`event_id` = 1 I then tried to switch the :joins with :include and got a whole jumbled mess that still returned me only the columns in User and none from EventPatron. What am I missing?

    Read the article

  • XPages Extension Library - onShow event for xe:djxmHeading

    - by Martin Perrie
    I am trying to add an onShow event to a Mobile Page Heading as per p. 326 oF the XPages Extension Library book. My code is as follows :- <xe:djxmHeading id="djxmHeading1" back="All Areas" moveTo="byArea"> <xe:this.label><![CDATA[#{javascript:param.get("Rep")}]]></xe:this.label> <xp:this.onShow> <![CDATA[#{javascript:sessionScope.put("RepName", param.get("Rep"))}]]> </xp:this.onShow> </xe:djxmHeading> which looks similar to the example in the book. But I'm getting the following error: Unknown property this.onShow. It is not defined on tag xe:djxmHeading. Any ideas what I'm doing wrong? Thanks

    Read the article

  • Dynamicly Inject img alt attribute jQuery

    - by Brock
    I need some help, and before we get going, I know it is probably not best practice, but I am doing some maintenance to an existing site and need to accomplish the following for a fix. <a rel="lightbox" href="site.com" title="a generated title"><img src="site.com/img" class="post-image" alt="a long description"/></a> Okay, so I am trying to figure out how to use jQuery or any other method to take the "alt" attribute from my image, and dynamically overwrite the "title" attribute of my "a" tag. Any help would be awesome, I am kinda lost at this juncture.

    Read the article

  • what type of errors can we handle using system define unnamed exception in sqlplus?

    - by Aspirant
    I have been trying to access the below code DECLARE N_DEPTNO DEPT.DEPTNO %TYPE :=&DEPT_NUM; V_DNAME DEPT.DNAME %TYPE; NOT_ENOUGH_VALUES EXCEPTION; PRAGMA EXCEPTION_INIT(NOT_ENOUGH_VALUES,-06502); BEGIN SELECT DNAME,LOC INTO DNAME FROM DEPT WHERE DEPTNO = N_DEPTNO; DBMS_OUTPUT.PUT_LINE('Successfully Fetched !!'); EXCEPTION WHEN NOT_ENOUGH_VALUES THEN DBMS_OUTPUT.PUT_LINE('No Enough Values ... '); END; It is still showing error message after specified it in EXCEPTION block. Can i handle these type of errors using PRAGMA EXCEPTION_INIT i.e not providing enough values in the select statement... If not what type of errors can be handled in System Defined Unnamed Exception using PRAGMA EXCEPTION_INIT.

    Read the article

  • how to load multiple images in iCarousel using this code?

    - by Dany
    i'm loading bunch of images in coverflow using i carousel but i'm not getting it?..initially i got Signal sigabart issue..after i edited some of the code the view gets displayed...Am i missing something?... #import "CollectionViewController.h" @interface CollectionViewController () @property (nonatomic, retain) NSMutableArray *items; @end @implementation CollectionViewController @synthesize carousel; @synthesize items; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } - (void)dealloc { carousel.delegate = nil; carousel.dataSource = nil; [items release]; [carousel release]; [super dealloc]; } - (void)viewDidLoad { [super viewDidLoad]; carousel.type = iCarouselTypeCoverFlow2; } - (void)viewDidUnload { [super viewDidUnload]; self.carousel = nil; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); } #pragma mark - #pragma mark iCarousel methods - (NSUInteger)numberOfItemsInCarousel:(iCarousel *)carousel { return [items count]; } - (NSUInteger)numberOfVisibleItemsInCarousel:(iCarousel *)carousel { return 29; } - (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index reusingView:(UIView *)view { //create new view if no view is available for recycling if (view == nil) { view = [NSArray arrayWithObjects:[UIImage imageNamed:@"gal1.jpg"], [UIImage imageNamed:@"gal2.jpg"], [UIImage imageNamed:@"gal3.jpg"], [UIImage imageNamed:@"gal5.jpg"], [UIImage imageNamed:@"gal6.jpg"], [UIImage imageNamed:@"gal7.jpg"], [UIImage imageNamed:@"gal8.jpg"], [UIImage imageNamed:@"gal9.jpg"], [UIImage imageNamed:@"gal10.jpg"], [UIImage imageNamed:@"gal11.jpg"], [UIImage imageNamed:@"gal12.jpg"], [UIImage imageNamed:@"gal13.jpg"], [UIImage imageNamed:@"gal14.jpg"], [UIImage imageNamed:@"gal15.jpg"], [UIImage imageNamed:@"gal16.jpg"], [UIImage imageNamed:@"gal17.jpg"], [UIImage imageNamed:@"gal18.jpg"], [UIImage imageNamed:@"gal19.jpg"], [UIImage imageNamed:@"gal20.jpg"], [UIImage imageNamed:@"gal21.jpg"], [UIImage imageNamed:@"gal22.jpg"], [UIImage imageNamed:@"gal23.jpg"], [UIImage imageNamed:@"gal24.jpg"], [UIImage imageNamed:@"gal25.jpg"], [UIImage imageNamed:@"gal26.jpg"], [UIImage imageNamed:@"gal27.jpg"], [UIImage imageNamed:@"gal28.jpg"], } else { } return view; } @end while running on simulator i just get the screen not images?...i got stuck here....

    Read the article

  • Returning std::vector by value

    - by deft_code
    It is oft said that in C++11 it is sane to return std::vector by value. In C++03 this was mostly true as RVO should optimize away the copy. But that should scared most developers away. In C++11 will a returned std::vector local variable always be moved? What if that vector is a member of a local variable instead of a local variable itself? Obviously returning a global variable will not be moved. What other cases will it not be moved?

    Read the article

  • sbt: "test" works "test:run" not

    - by Martin
    I try to establish a build pipeline on Jenkins with a Play(2.0.2) project. As I want to just build the sources once and use the classes for downstream builds, I now have created a "compile"-job, that runs "sbt test:compile". That works so far. The next job should then just run the compiled tests. If I use "sbt test" it works as expected, but compiles the sources again. But if I try to run "sbt test:run" it says: [info] Loading project definition from ~/myproject/project [info] Set current project to myproject (in build file: ~/myproject/) java.lang.RuntimeException: No main class detected. at scala.sys.package$.error(package.scala:27) [error] {file:~/myproject/test:run: No main class detected. The same happens locally. I can run "sbt test" but not "sbt test:run". Same error. Is there someone who can point me to the right direction?

    Read the article

  • How to make IE and Firefox display hidden elements the same (IE shifts visible element)

    - by Dale
    Rendering the same html in IE and Firefox gives me a different result because in IE, the hidden checkbox is not ignored, from a layout perspective: <html><head> <style type="text/css"> <!-- #checkboxhide { position: relative; visibility: hidden; font-size: 8.5pt; font-weight: font-family: verdana;} //--> </style> </head><body> <table><tr> <td>|</td> <td><span id="checkboxhide"><input type="checkbox" hidden="" name="blah"></span>|Greetings Earthings</td> </tr></table> </body></html> How can I get the two (or more) browsers to show the same thing?

    Read the article

  • How to use void*

    - by Rondogiannis Aristophanes
    I am imlementing a simple merge function and I have got stuck, as the compiler gives me errors that I cannot explain. Here is my merge function: void merge(void *a, int beg, int middle, int end, int (*cmp)(const void*, const void* { std::stack<void*> first; std::stack<void*> second; for(int i = beg; i < middle; i++) { first.push(a+i); } for(int i = middle; i < end; i++) { second.push(a+i); } for(int i = beg; i < end; i++) { if(first.empty()) { void *tmp = second.top(); second.pop(); a+i = tmp; } else if(second.empty()) { void *tmp = first.top(); first.pop(); a+i = tmp; } else if(cmp(first.top(), second.top())) { void *tmp = first.top(); first.pop(); a+i = tmp; } else { void *tmp = second.top(); second.pop(); a+i = tmp; } } } And here is the error: sort.h: In function `void merge(void*, int, int, int, int (*)(const void*, const void*))': sort.h:9: error: pointer of type `void *' used in arithmetic sort.h:12: error: pointer of type `void *' used in arithmetic sort.h:19: error: pointer of type `void *' used in arithmetic sort.h:19: error: non-lvalue in assignment sort.h:23: error: pointer of type `void *' used in arithmetic sort.h:23: error: non-lvalue in assignment sort.h:27: error: pointer of type `void *' used in arithmetic sort.h:27: error: non-lvalue in assignment sort.h:31: error: pointer of type `void *' used in arithmetic sort.h:31: error: non-lvalue in assignment Can anyone help me? TIA.

    Read the article

  • SUM of column with Left Outer Join

    - by Matt
    I am trying to get the Count of all records that have at least on person who is authorized on the record. Basically, a Record can have more than one person associated with it. I want to return the count of Total Records, a count of total Authorized Records where at least 1 person is authorized, and a count of total NotAuthorized records where no person associated with record is authorized. It doesn't matter if one person is authorized per Record or if 3 people are authorized for that record, that should add 1 to the Authorized counter. The current query is incrementing Auth and Non auth for each person added per record rather, than one per record. If no people are assigned to the record that should also count towards Not Auth. SELECT Count(DISTINCT Record.RecordID) AS TotalRecords, SUM(CASE WHEN People.PersonLevel = 1 THEN 1 ELSE 0 END) AS Authorized, SUM(CASE WHEN People.PersonLevel <> 1 THEN 1 ELSE 0 END) AS NotAuthorized FROM Record LEFT OUTER JOIN RecordPeople ON Record.RecordID = RecordPeople.RecordID LEFT OUTER JOIN People ON RecordPeople.PersonID = People.PersonID

    Read the article

  • Non-auto-increment rails/postgresql column

    - by Redian
    I'm trying to have a model/table with duplicate information in it. The reason for this is so that the same data can be written to the table under different users and found for each user. However, I want a quick easy way to identify which information is a duplicate of other information. I think the best way to do this would be to have an item_id of sorts that increments with each "set" of entries to the table. Is there a way to do this without including another table that stores the information without attributing it to users?

    Read the article

  • Variable won't store in session

    - by Mittens
    So I'm trying to store the "rank" of a user when they log in to a control panel which displays different options depending on the given rank. I used the same method as I did for storing and displaying the username, which is displayed on the top of each page and works just fine. I can't for the life of me figure out why it won't work for the rank value, but I do know that it is not saving it in the session. Here is the bit that's not working; $username = ($_POST['username']); $password = hash('sha512', $_POST['password']); $dbhost = 'mysql:host=¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦;dbname=¦¦¦¦¦¦¦¦¦¦¦'; $dbuser = '¦¦¦¦¦¦¦¦¦¦¦'; $dbpassword = '¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦'; try { $db = new PDO($dbhost, $dbuser, $dbpassword); $statement = $db->prepare("select password from users where email = :name"); $statement->execute(array(':name' => $username)); $result = $statement->fetch(); $pass = $result[password]; $rank = $result[rank];} catch(PDOException $e) {echo $e->getMessage();} if ($password == $pass) { session_start(); $_SESSION['username'] = $username; $_SESSION['rank'] = $rank; header('Location: http://¦¦¦¦¦¦¦¦¦.ca/manage.php'); } else{ include'../../includes/head.inc'; echo '<h1>Incorrect username or password.</h1>'; include'../../includes/footer.inc'; } I'm also new to the whole PDO thing, hence why my method of authenticating the password is pretty sketchy.

    Read the article

  • MFC CDialog not showing

    - by Jesus_21
    here is my problem : In my Solution, I have 2 projects, one is a lib in which I created a ressource file (mylib.rc) and a dialog template in it. Then I made a class which inherits CDialog and uses this template. But when I instantiate it and call DoModal(), nothing appends... here the code of my class, is something wrong with it ? MyDialog.h /*MyDialog.h*/ #pragma once #include "../../../resource.h" class MyDialog : public CDialog { enum {IDD=IDD_DLGTEMPLATE}; public: MyDialog(CWnd* pParent = NULL); virtual ~MyDialog(); protected: virtual BOOL OnInitDialog(); DECLARE_MESSAGE_MAP() private: afx_msg void OnBnClickedOk(); afx_msg void OnBnClickedCancel(); }; MyDialog.cpp /*MyDialog.cpp*/ #include "stdafx.h" #include "MyDialog.h" MyDialog::MyDialog(CWnd* pParent /*=NULL*/) : CDialog(IDD_DLGTEMPLATE, pParent) {} MyDialog::~MyDialog() {} BOOL MyDialog::OnInitDialog() { return TRUE; } BEGIN_MESSAGE_MAP(MyDialog, CDialog) ON_BN_CLICKED(IDOK, &MyDialog::OnBnClickedOk) ON_BN_CLICKED(IDCANCEL, &MyDialog::OnBnClickedCancel) END_MESSAGE_MAP() void MyDialog::OnBnClickedOk() { OnOK(); } void MyDialog::OnBnClickedCancel() { OnCancel(); }

    Read the article

  • What is design principle behind Servlets being Singleton

    - by Sandeep Jindal
    A servlet container "generally" create one instance of a servlet and different threads of the same instance to serve multiple requests. (I know this can be changed using deprecated SingleThreadModel and other features, but this is the usual way). I thought, the simple reason behind this is performance gain, as creating threads is better than creating instances. But it seems this is not the reason. On the other hand, creating instances have little advantage that developers never have to worry about thread safety. I am trying to understand the reason for this decision over the trade-off of thread-safety.

    Read the article

  • ocjective-c Obtain return value from public method

    - by Felix
    I'm pretty new to objective-C (and C in general) and iPhone development and am coming from the java island, so there are some fundamentals that are quite tough to learn for me. I'm diving right into iOS5 and want to use storyboards. For now I am trying to setup a list in a UITableViewController that will be filled with values returned by a web service in the future. For now, I just want to generate some mock objects and show their names in the list to be able to proceed. Coming from java, my first approach would be to create a new Class that provides a global accessible method to generate some objects for my list: #import <Foundation/Foundation.h> @interface MockObjectGenerator : NSObject +(NSMutableArray *) createAndGetMockProjects; @end Implementation is... #import "MockObjectGenerator.h" // Custom object with some fields #import "Project.h" @implementation MockObjectGenerator + (NSMutableArray *) createAndGetMockObjects { NSMutableArray *mockProjects = [NSMutableArray alloc]; Project *project1 = [Project alloc]; Project *project2 = [Project alloc]; Project *project3 = [Project alloc]; project1.name = @"Project 1"; project2.name = @"Project 2"; project3.name = @"Project 3"; [mockProjects addObject:project1]; [mockProjects addObject:project2]; [mockProjects addObject:project3]; } And here is my ProjectTable.h that is supposed to control my ListView #import <UIKit/UIKit.h> @interface ProjectsTable : UITableViewController @property (strong, nonatomic) NSMutableArray *projectsList; @end And finally ProjectTable.m #import "ProjectsTable.h" #import "Project.h" #import "MockObjectGenerator.h" @interface ProjectsTable { @synthesize projectsList = _projectsList; -(id)initWithStyle:(UITableViewStyle:style { self = [super initWithStyle:style]; if (self) { _projectsList = [[MockObjectGenerator createAndGetMockObjects] copy]; } return self; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // only one section for all return 1; - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { NSLog(@"%d entries in list", _projectsList.count); return _projectsList.count; - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { // the identifier of the lists prototype cell is set to this string value static NSString *CellIdentifier = @"projectCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; Project *project = [_projectsList objectAtIndex:indexPath.row]; cell.textLabel.text = project.name } So while I think everything is correctly set, I expect the tableView to show my three mock objects in its rows. But it stays empty and the NSLog method prints "0 entries in list" into the console. So what am I doing wrong? Any help is appreciated. Best regards Felix

    Read the article

  • Can an ActiveRecord before_save filter halt the save without halting the transaction?

    - by Michael Boutros
    Is there any way for a before_save filter to halt the entire save without halting the transaction? What I'm trying to do is have a "sample" version of my model that the user can interact with and save but the changes themselves are never actually saved. The following will halt the transaction and (naturally) return false when I call @model.update_attributes: before_filter :ignore_changes_if_sample def ignore_changes_if_sample if self.sample? return false end end Thanks!

    Read the article

  • Android XML Preference issue. Can't make it persistent

    - by Budius
    I have a very simple activity just to show the preference fragment: public class PreferencesActivity extends Activity { Fragment frag = null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); FragmentTransaction ft = getFragmentManager().beginTransaction(); if (frag == null) { // If not, instantiate and add it to the activity frag = new PrefsFragment(); ft.add(android.R.id.content, frag, frag.getClass().getName()); } else { // If it exists, simply attach it in order to show it ft.attach(frag); } ft.commit(); } private static class PrefsFragment extends PreferenceFragment { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.preferences); } } } and preferences.xml with persistent to true: <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" android:enabled="true" android:persistent="true" android:title="@string/settings" > <EditTextPreference android:dialogTitle="@string/dialog_ip" android:negativeButtonText="@android:string/cancel" android:persistent="true" android:positiveButtonText="@android:string/ok" android:title="@string/ip" /> </PreferenceScreen> if I open the EditTextPreference, write something, close the dialog and open it again. The value is still there. But that's it... if I click the Back button, and enter the again on the preferences screen, I already lost what was written. If you exit the application also doesn't save. Am I missing something here? Running on: Android 4.0.3 Asus TF300

    Read the article

  • Find Adjacent Nodes A Star Path-Finding C++

    - by Infinity James
    Is there a better way to handle my FindAdjacent() function for my A Star algorithm? It's awfully messy, and it doesn't set the parent node correctly. When it tries to find the path, it loops infinitely because the parent of the node has a pent of the node and the parents are always each other. Any help would be amazing. This is my function: void AStarImpl::FindAdjacent(Node* pNode) { for (int i = -1; i <= 1; i++) { for (int j = -1; j <= 1; j++) { if (pNode->mX != Map::GetInstance()->mMap[pNode->mX + i][pNode->mY + j].mX || pNode->mY != Map::GetInstance()->mMap[pNode->mX + i][pNode->mY + j].mY) { if (pNode->mX + i <= 14 && pNode->mY + j <= 14) { if (pNode->mX + i >= 0 && pNode->mY + j >= 0) { if (Map::GetInstance()->mMap[pNode->mX + i][pNode->mY + j].mTypeID != NODE_TYPE_SOLID) { if (find(mOpenList.begin(), mOpenList.end(), &Map::GetInstance()->mMap[pNode->mX + i][pNode->mY + j]) == mOpenList.end()) { Map::GetInstance()->mMap[pNode->mX+i][pNode->mY+j].mParent = &Map::GetInstance()->mMap[pNode->mX][pNode->mY]; mOpenList.push_back(&Map::GetInstance()->mMap[pNode->mX+i][pNode->mY+j]); } } } } } } } mClosedList.push_back(&Map::GetInstance()->mMap[pNode->mX][pNode->mY]); } If you'd like any more code, just ask and I can post it.

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >