Search Results

Search found 5328 results on 214 pages for 'life experiences'.

Page 11/214 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Understanding the passing of data/life of a script in web development/CodeIgniter

    - by Pete Jodo
    I hope I worded the title accurately enough but I typically use Java and don't have much experience in Web Development/PHP/CodeIgniter. I have a difficult time understanding the life cycle of a script as I found out trying to implement a certain feature to a website I am developing (as a means of learning how to). I'll first describe the feature I tried implementing and then the problem I ran into that made me question my fundamental understanding of how scripts work since I'm used to typical OOP. Ok so here goes... I have a webpage that has 2 basic tasks a user can do, create and delete an entry. What I attempted to implement was a way to time a user how long it takes them to complete a certain task. The way I did this was have a homepage where there would be a list of tasks a user to choose from (in this case 2, create and delete). A user would click a task which would link to the 'true' homepage where the user then would be expected to complete the task. My script looks like this: <?php class Site extends CI_Controller { var $task1; var $tasks = array( "task1" => NULL, "date1" => 0, "date2" => 0, "diff" => 0); function __construct() { parent::__construct(); include 'timetask.php'; $this->task1 = new TimeTask("create"); } function index() { $this->tasks['task1'] = $this->task1->getTask(); $this->tasks['diff'] = $this->task1->getTimeDiff(); if($this->tasks['diff'] == NULL) { $this->tasks['diff'] = 0; } $this->load->view('usability_test', $this->tasks); } function origIndex() { $this->task1->setDate1(new DateTime()); $this->tasks['date1'] = $this->task1->getDate1()->getTimestamp(); $data = array(); if($q = $this->site_model->get_records()) { $data['records'] = $q; } $this->load->view('options_view', $data); } function create() { $this->task1->setDate2(new DateTime()); $this->tasks['date2'] = $this->task1->getDate2()->getTimestamp(); $data = array( 'author' => $this->input->post('author'), 'title' => $this->input->post('title'), 'contents' => $this->input->post('contents') ); $this->site_model->add_record($data); $this->index(); } I only included create to keep it short. Then I also have the TimeTask class, that actually another StackOverflow so kindly helped me with: <?php class TimeTask { private $task; /** * @var DateTime */ private $date1, $date2; function __construct($currTask) { $this->task = $currTask; } public function getTimeDiff() { $hasDiff = $this->date1 && $this->date2; if ($hasDiff) { return $this->date2->getTimestamp() - $this->date1->getTimestamp(); } else { return NULL; } } public function __toString() { return (string) $this->getTimeDiff(); } /** * @return \DateTime */ public function getDate1() { return $this->date1; } /** * @param \DateTime $date1 */ public function setDate1(DateTime $date1) { $this->date1 = $date1; } /** * @return \DateTime */ public function getDate2() { return $this->date2; } /** * @param \DateTime $date2 */ public function setDate2(DateTime $date2) { $this->date2 = $date2; } /** * @return get current task */ public function getTask() { return $this->task; } } ?> I don't think posting the views is necessary for the question but here is atleast how the links are made. ...and... id", $row-title); ? Now there's no error in the code but it doesn't do what I expect of it and the reason I assume why is because that each time a function of the script is called via a new page it is NOT the same instance of the script called previously so any previously created objects are no longer there. This confuses me and leaves me quite unsure of how to implement this gracefully. Some ways I would guess of how to do this is by passing the necessary data through the URL or have data saved in a database and retrieve it later to compare the times. What would be a recommended way to do, not just this, but anything that needs previously created data? Also, am I correct to think that a script is only 'alive' for one webpage at a time? Thanks!

    Read the article

  • Re-Calibrate Toshiba battery meter with Windows 7

    - by Mark Henderson
    I have a Toshiba U300 laptop. Back in the olden days (circa-2000) you could re-calibrate the battery meter from the BIOS when your battery was no longer reading accurately. My battery was shot, so I bought a brand new one, however Windows 7 still seems to count down the battery life in at the same speed as the old one did. This time, when it alleged 0%, I turned the laptop back on and got another 90 minutes of life out of it, at 0%. Is there a tool or utility for Toshiba laptops that can fix it back to being accurate? I've read the other threads on SU about cycling the battery but that just doesn't seem to do it in this case. Update: After the last cycle, the battery meter now reads 100% but the indicator on the front of the laptop is still orange (indicating not fully charged)

    Read the article

  • Re-Calibrate Toshiba battery meter with Windows 7

    - by Farseeker
    Hi All. I have a Toshiba U300 laptop. Back in the olden days (circa-2000) you could re-calibrate the battery meter from the BIOS when your battery was no longer reading accurately. My battery was shot, so I bought a brand new one, however Windows 7 still seems to count down the battery life in at the same speed as the old one did. This time, when it alleged 0%, I turned the laptop back on and got another 90 minutes of life out of it, at 0%. Is there a tool or utility for Toshiba laptops that can fix it back to being accurate? I've read the other threads on SU about cycling the battery but that just doesn't seem to do it in this case. Update: After the last cycle, the battery meter now reads 100% but the indicator on the front of the laptop is still orange (indicating not fully charged)

    Read the article

  • no more hitcollision at 1 life

    - by user1449547
    So I finally got my implementation of lives fixed, and it works. Now however when I collide with a ghost when I am at 1 life, nothing happens. I can fall to my death enough times for a game over. from what i can tell the problem is that hit collision is not longer working, because it does not detect a hit, I do not fall. the question is why? update if i kill myself fast enough it works, but if i play for like 30 seconds, it stops the hit collision detection on my ghosts. platforms and springs still work. public class World { public interface WorldListener { public void jump(); public void highJump(); public void hit(); public void coin(); public void dying(); } public static final float WORLD_WIDTH = 10; public static final float WORLD_HEIGHT = 15 * 20; public static final int WORLD_STATE_RUNNING = 0; public static final int WORLD_STATE_NEXT_LEVEL = 1; public static final int WORLD_STATE_GAME_OVER = 2; public static final Vector2 gravity = new Vector2(0, -12); public Hero hero; public final List<Platform> platforms; public final List<Spring> springs; public final List<Ghost> ghosts; public final List<Coin> coins; public Castle castle; public final WorldListener listener; public final Random rand; public float heightSoFar; public int score; public int state; public int lives=3; public World(WorldListener listener) { this.hero = new Hero(5, 1); this.platforms = new ArrayList<Platform>(); this.springs = new ArrayList<Spring>(); this.ghosts = new ArrayList<Ghost>(); this.coins = new ArrayList<Coin>(); this.listener = listener; rand = new Random(); generateLevel(); this.heightSoFar = 0; this.score = 0; this.state = WORLD_STATE_RUNNING; } private void generateLevel() { float y = Platform.PLATFORM_HEIGHT / 2; float maxJumpHeight = Hero.hero_JUMP_VELOCITY * Hero.hero_JUMP_VELOCITY / (2 * -gravity.y); while (y < WORLD_HEIGHT - WORLD_WIDTH / 2) { int type = rand.nextFloat() > 0.8f ? Platform.PLATFORM_TYPE_MOVING : Platform.PLATFORM_TYPE_STATIC; float x = rand.nextFloat() * (WORLD_WIDTH - Platform.PLATFORM_WIDTH) + Platform.PLATFORM_WIDTH / 2; Platform platform = new Platform(type, x, y); platforms.add(platform); if (rand.nextFloat() > 0.9f && type != Platform.PLATFORM_TYPE_MOVING) { Spring spring = new Spring(platform.position.x, platform.position.y + Platform.PLATFORM_HEIGHT / 2 + Spring.SPRING_HEIGHT / 2); springs.add(spring); } if (rand.nextFloat() > 0.7f) { Ghost ghost = new Ghost(platform.position.x + rand.nextFloat(), platform.position.y + Ghost.GHOST_HEIGHT + rand.nextFloat() * 3); ghosts.add(ghost); } if (rand.nextFloat() > 0.6f) { Coin coin = new Coin(platform.position.x + rand.nextFloat(), platform.position.y + Coin.COIN_HEIGHT + rand.nextFloat() * 3); coins.add(coin); } y += (maxJumpHeight - 0.5f); y -= rand.nextFloat() * (maxJumpHeight / 3); } castle = new Castle(WORLD_WIDTH / 2, y); } public void update(float deltaTime, float accelX) { updatehero(deltaTime, accelX); updatePlatforms(deltaTime); updateGhosts(deltaTime); updateCoins(deltaTime); if (hero.state != Hero.hero_STATE_HIT) checkCollisions(); checkGameOver(); checkFall(); } private void updatehero(float deltaTime, float accelX) { if (hero.state != Hero.hero_STATE_HIT && hero.position.y <= 0.5f) hero.hitPlatform(); if (hero.state != Hero.hero_STATE_HIT) hero.velocity.x = -accelX / 10 * Hero.hero_MOVE_VELOCITY; hero.update(deltaTime); heightSoFar = Math.max(hero.position.y, heightSoFar); } private void updatePlatforms(float deltaTime) { int len = platforms.size(); for (int i = 0; i < len; i++) { Platform platform = platforms.get(i); platform.update(deltaTime); if (platform.state == Platform.PLATFORM_STATE_PULVERIZING && platform.stateTime > Platform.PLATFORM_PULVERIZE_TIME) { platforms.remove(platform); len = platforms.size(); } } } private void updateGhosts(float deltaTime) { int len = ghosts.size(); for (int i = 0; i < len; i++) { Ghost ghost = ghosts.get(i); ghost.update(deltaTime); if (ghost.state == Ghost.GHOST_STATE_DYING && ghost.stateTime > Ghost.GHOST_DYING_TIME) { ghosts.remove(ghost); len = ghosts.size(); } } } private void updateCoins(float deltaTime) { int len = coins.size(); for (int i = 0; i < len; i++) { Coin coin = coins.get(i); coin.update(deltaTime); } } private void checkCollisions() { checkPlatformCollisions(); checkGhostCollisions(); checkItemCollisions(); checkCastleCollisions(); } private void checkPlatformCollisions() { if (hero.velocity.y > 0) return; int len = platforms.size(); for (int i = 0; i < len; i++) { Platform platform = platforms.get(i); if (hero.position.y > platform.position.y) { if (OverlapTester .overlapRectangles(hero.bounds, platform.bounds)) { hero.hitPlatform(); listener.jump(); if (rand.nextFloat() > 0.5f) { platform.pulverize(); } break; } } } } private void checkGhostCollisions() { int len = ghosts.size(); for (int i = 0; i < len; i++) { Ghost ghost = ghosts.get(i); if (hero.position.y < ghost.position.y) { if (OverlapTester.overlapRectangles(ghost.bounds, hero.bounds)){ hero.hitGhost(); listener.hit(); } break; } else { if(hero.position.y > ghost.position.y) { if (OverlapTester.overlapRectangles(hero.bounds, ghost.bounds)){ hero.hitGhostJump(); listener.jump(); ghost.dying(); score += Ghost.GHOST_SCORE; } break; } } } } private void checkItemCollisions() { int len = coins.size(); for (int i = 0; i < len; i++) { Coin coin = coins.get(i); if (OverlapTester.overlapRectangles(hero.bounds, coin.bounds)) { coins.remove(coin); len = coins.size(); listener.coin(); score += Coin.COIN_SCORE; } } if (hero.velocity.y > 0) return; len = springs.size(); for (int i = 0; i < len; i++) { Spring spring = springs.get(i); if (hero.position.y > spring.position.y) { if (OverlapTester.overlapRectangles(hero.bounds, spring.bounds)) { hero.hitSpring(); listener.highJump(); } } } } private void checkCastleCollisions() { if (OverlapTester.overlapRectangles(castle.bounds, hero.bounds)) { state = WORLD_STATE_NEXT_LEVEL; } } private void checkFall() { if (heightSoFar - 7.5f > hero.position.y) { --lives; hero.hitSpring(); listener.highJump(); } } private void checkGameOver() { if (lives<=0) { state = WORLD_STATE_GAME_OVER; } } }

    Read the article

  • Cross-platform DirectShow alternatives for real life graph

    - by Ole Jak
    Today I have such graph. I run it on windows I need some easy crossplatform DirectShow like alternative where to reconstruct such graph will not be a hard task. Where can I get such alternative? *(and If you can presenta way to reconstruct such graph in It It would be grate!) BTW: By crossplatform I mean Linux Mac and Windows compatible, By using SampleGrabber I ment I need to be able to get data from that step of graph from my programm and I use VirtualCamera from here soundmorning.com/download.php

    Read the article

  • Grails - Development advice - Where do I find Plugin APIs / Troubleshoot errors / Make life easy for

    - by gav
    Hello fellow Grails Developers! I was wondering if you could help me with what must be a very common issue. I have come from a world of Java and eclipse where JavaDocs and APIs are at your fingertips. Grails has some great features and plugins but I find their inner workings completely undescoverable and that makes me sad. Take for example the excellent authentication plugin, I set this up using the brief but accurate doc. Now I'm in eclipse with STS and I'm staring at a method; applicationContext.authenticationService.filterRequest( request, response, "${request.contextPath}/authentication/index" ) Which is throwing an exception; 2010-05-01 01:17:07,292 [http-8080-1] ERROR [/grailsapp].[default] - Servlet.service() for servlet default threw exception java.lang.IllegalStateException at org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:407) at javax.servlet.http.HttpServletResponseWrapper.sendError(HttpServletResponseWrapper.java:118) at org.codehaus.groovy.grails.web.sitemesh.GrailsPageResponseWrapper.sendError(GrailsPageResponseWrapper.java:91) And I have no idea where to start. I would love to have eclipse link to the source but there must be other manageable alternatives too as I know some people use TextMate or vim for development, they can't all have discovered the APIs for the plugins through trial and error!?! Is there any way of making the core Grails API more accessible / searchable? Autocomplete also doesn't seem to work for me in eclipse so if anyone has this working that would be ideal (It's an extension of the same question really). What's your approach? (Please don't say intelliJ, I can't afford it) I'm sure it's obvious and I'm just missing it, please put me out of my misery! Thanks in advance, Gav

    Read the article

  • Pattern for managing reference count and object life

    - by Gopalakrishnan Subramani
    We have a serial port which is connected to hundreds of physical devices on the same wire. We have protocols like Modbus and Hart to handle the request and response between the application and devices. The question is related to managing the reference count of the channel. When no device is using the channel, the channel should be closed. public class SerialPortChannel { int refCount = 0; public void AddReference() { refCount++; } public void ReleaseReference() { refCount--; if (refCount <= 0) this.ReleasePort(); //This close the serial port } } For each device connected, we create a object for the device like device = new Device(); device.Attach(channel); //this calls channel.AddReference() When the device disconnect, device.Detach(channel); //this calls channel.ReleaseReference() I am not convinced by the reference count model. Are there any better way to handle this problem in .NET World?

    Read the article

  • Entity Framework ObjectContext Life-cycle

    - by Leonardo
    Hello, I'm developing a web application using asp.net 4.0 with Entity Framework. In my apllication I have a page DataEntry.aspx wich has 3 web user control.Each user control manage an entity and use a repository class to access data. The final user before save all the changes can add or remove entity in memory. My question is: how can i share the ObjectContext between the repositories? Basically I need a ObjectContext for the entire session working of DataEntry.aspx. How can I achive this? Thank you

    Read the article

  • How do you make life easier for yourself when developing a really large database

    - by Hannes de Jager
    I am busy developing 2 web based systems with MySql databases and the amount of tables/views/stored routines is really becoming a lot and it is more and more challenging to handle the complexity. Now in programming languages we have namespacing e.g. Java packages, C++ namespaces to partition the software, grouping it together to make things more understandable. Databases on the other hand have more of a flat structure (MySql at least) e.g. tables and stored procedures are on the same level. So one have to be more creative, creating naming conventions, perhaps use more than one database or using tools to visualize things. What methods do you use to ease the pain? To be effective while developing your databases? To not get lost in a sea of tables and fields and stored procs? Feel free to mention tools you use also, but try to restrict it to open source and preferably Linux solutions if thats OK. b.t.w How many tables would a database have to be considered large in terms of design?

    Read the article

  • asp.net page life-cycle question

    - by Varyanica
    I have a Table and a Button. Table's cells have controls LiteralControl and CheckBox. I check some fields and then by click on button i remove these fields from database. On event Page_PreRender i clear Table and then fill it with updated data. Then it shows me Table with updated data. But if i check fields of table again and do a click on a button it wont do what i expected. In Page_Load event i see that it dont save properties of controls. Checked CheckBox controls appears as unchecked.

    Read the article

  • Understanding Hibernate saveOrUpdate and the Persistence Life Cycle

    - by Stephano
    The books that I've read regarding hibernate are, at best, reference tomes. They very seldom have good code examples, so I tend to use online resources for those needs. However, I've always had a problem understanding the basic idea of hibernate persistence. I've read the books and understand the concepts, but in practice, I often see results that I don't understand. Perhaps you all can help, as you have in the past. Let's look at a simple example of a dog and a cat that are friends. This isn't a rare occurrence. It also has the benefit of being much more interesting than my business case. We want a function called "saveFriends" that takes a dog name and a cat name. We'll save the Dog and then the Cat. For this example to work, the cat is going to have a reference back to the dog. I understand this isn't an ideal example, but it's cute and works for our purposes. FriendService.java public int saveFriends(String dogName, String catName) { Dog fido = new Dog(); Cat felix = new Cat(); fido.name = dogName; fido = animalDao.saveDog(fido); felix.name = catName; [ex.A]felix.friend = fido; [ex.B]felix.friend = animalDao.getDogByName(dogName); animalDao.saveCat(felix); } AnimalDao.java (extends HibernateDaoSupport) public Dog saveDog(Dog dog) { getHibernateTemplate().saveOrUpdate(dog); return dog } public Cat saveCat(Cat cat) { getHibernateTemplate().saveOrUpdate(cat); return cat; } public Dog getDogByName(String name) { return (Dog) getHibernateTemplate().find("from Dog where name=?", name).get(0); } Now, assume for a minute that I would like to use either example A or example B to save my friend. Is one better than the other to use? I'll understand if neither of those examples work, but please explain why.

    Read the article

  • Heroku in real life apps

    - by Victor P
    What is your experience using Ruby on Rails on Heroku in production mode? Apart of the issue of the expensive https, do you see any drawback in the way it manages processes, memory and storage? The people at Heroku is quite nice and I'm sure they are willing to answer my questions, but I would like some opinions in the customer side.

    Read the article

  • A NSMutableArray is destroying my life!

    - by camilo
    EDITED to show the relevant part of the code Hi. There's a strange problem with an NSMutableArray which I'm just not understanding... Explaining: I have a NSMutableArray, defined as a property (nonatomic, retain), synthesized, and initialized with 29 elements. realSectionNames = [[NSMutableArray alloc] initWithCapacity:29]; After the initialization, I can insert elements as I wish and everything seems to be working fine. While I'm running the application, however, if I insert a new element in the array, I can print the array in the function where I inserted the element, and everything seems ok. However, when I select a row in the table, and I need to read that array, my application crashes. In fact, it cannot even print the array anymore. Is there any "magical and logical trick" everybody should know when using a NSMutableArray that a beginner like myself can be missing? Thanks a lot. I declare my array as realSectionNames = [[NSMutableArray alloc] initWithCapacity:29]; I insert objects in my array with [realSectionNames addObject:[category categoryFirstLetter]]; although I know i can also insert it with [realSectionNames insertObject:[category categoryFirstLetter] atIndex:i]; where the "i" is the first non-occupied position. After the insertion, I reload the data of my tableView. Printing the array before or after reloading the data shows it has the desired information. After that, selecting a row at the table makes the application crash. This realSectionNames is used in several UITableViewDelegate functions, but for the case it doesn't matter. What truly matters is that printing the array in the beginning of the didSelectRowAtIndexPath function crashes everything (and of course, doesn't print anything). I'm pretty sure it's in that line, for printing anything he line before works (example): NSLog(@"Anything"); NSLog(@"%@", realSectionNames); gives the output: 2010-03-24 15:16:04.146 myApplicationExperience[3527:207] Anything [Session started at 2010-03-24 15:16:04 +0000.] GNU gdb 6.3.50-20050815 (Apple version gdb-967) (Tue Jul 14 02:11:58 UTC 2009) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-apple-darwin".sharedlibrary apply-load-rules all Attaching to process 3527. Still not understanding what kind of stupidity I've done this time... maybe it's not too late to follow the career of brain surgeon?

    Read the article

  • Life Scope of Temporary Variable

    - by Yan Cheng CHEOK
    #include <cstdio> #include <string> void fun(const char* c) { printf("--> %s\n", c); } std::string get() { std::string str = "Hello World"; return str; } int main() { const char *cc = get().c_str(); // cc is not valid at this point. As it is pointing to // temporary string internal buffer, and the temporary string // has already been destroyed at this point. fun(cc); // But I am surprise this call will yield valid result. // It seems that the returned temporary string is valid within // scope (...) // What my understanding is, scope means {...} // Is this valid behavior guarantee by C++ standard? Or it depends // on your compiler vendor implementations? fun(get().c_str()); getchar(); } The output is : --> --> Hello World Hello, may I know the correct behavior is guarantee by C++ standard, or it depends on your compiler vendor implementations? I have tested this under VC2008 and VC6. Works fine for both.

    Read the article

  • Open source real life license examples: yours or others

    - by donpal
    I'm aware of the usual list of open source licenses, so I'm not even going to list it here. What I'd like to ask is about your open source projects (whether out or planned for the future), and why you're planning to choose a certain license over the other. Basically say I went for X license because I wanted Y and that other license didn't provide it for me. I understand that the language itself can make a difference in the choice of license: interpreted languages like PHP vs. compiled languages like Java. I'm mostly interested in hearing about PHP projects, but of course additional insights are welcome. You may even have chosen that particular language for a licensing reason. Ideally I want to hear answers from people who were involved in the actual project (i.e. your own project), because that usually means you've put some thought into the license yourself and understand the implications of that license. But examples of existing projects that aren't your own are OK. Please just say why you think that license was good/bad for them. But first-hand experience is preferred. Looking forward to hearing some informative input.

    Read the article

  • c++, object life-time of anonymous (unnamed) variables

    - by Joe Steeve
    In the following code, the object constructed in the last line of 'main()', seems to be destroyed before the end of the expression. The destructor is called before the '<<' is executed. Is this how it is supposed to be? #include <string> #include <sstream> #include <iostream> using std::string; using std::ostringstream; using std::cout; class A : public ostringstream { public: A () {} virtual ~A () { string s; s = str(); cout << "from A: " << s << std::endl; } }; int main () { string s = "Hello"; A os; os << s; cout << os.str() << std::endl; A() << "checking this"; } This is the output: Hello from A: 0x80495f7 from A: Hello This is the gdb log: (gdb) b os.cxx : 18 Breakpoint 1 at 0x80492b1: file os.cxx, line 18. (2 locations) (gdb) r Starting program: /home/joe/sandbox/test/os Hello Breakpoint 1, ~A (this=0xbffff37c, __in_chrg=<value optimized out>, __vtt_parm=<value optimized out>) at os.cxx:18 18 cout << "from A: " << s << std::endl; (gdb) p s.c_str () $1 = 0x804b45c "0x80495f7" (gdb) p *s.c_str () $2 = 48 '0' (gdb) c Continuing. from A: 0x80495f7 Breakpoint 1, ~A (this=0xbffff2bc, __in_chrg=<value optimized out>, __vtt_parm=<value optimized out>) at os.cxx:18 18 cout << "from A: " << s << std::endl; (gdb) p s.c_str () $3 = 0x804b244 "Hello" (gdb) p *s.c_str () $4 = 72 'H' (gdb) c Continuing. from A: Hello Program exited normally. (gdb)

    Read the article

  • How to create real-life robots?

    - by Click Upvote
    Even before I learnt programming I've been fascinated with how robots could work. Now I know how the underlying programming instructions would be written, but what I don't understand is how those intructions are followed by the robot. For example, if I wrote this code: object=Robot.ScanSurroundings(300,400); if (Objects.isEatable(object)) { Robot.moveLeftArm(300,400); Robot.pickObject(object); } How would this program be followed by the CPU in a way that would make the robot do the physical action of looking to the left, moving his arm, and such? Is it done primarily in binary language/ASM? Lastly, where would i go if I wanted to learn how to create a robot?

    Read the article

  • Public static variables and Android activity life cycle management

    - by jsstp24n5
    According to the documentation the Android OS can kill the activity at the rear of the backstack. So, say for example I have an app and open the Main Activity (let's call it Activity A). In this public activity class I declare and initialize a public static variable (let's call it "foo"). In Activity A's onCreate() method I then change the value of "foo." From Activity A the user starts another activity within my app called Activity B. Variable "foo" is used in Activity B. Activity B is then paused after the user navigates to some other activities in other apps. Eventually, after a memory shortage occurs, Activity A then Activity B can be killed. After the user navigates back to my app it restarts (actually "recreates") activity B. What happens: 1) Will variable "foo" at this point have the value that was set to it when Activity A's onCreate() method ran? 2) Variable "foo" does not exist? 3) Variable "foo" exists and but is now the initialized value and not the value set in Activity A's onCreate() method?

    Read the article

  • Real life Java Swing Project

    - by santiagobasulto
    Hi everybody! I've been working with swing for the last 2 years, but i'm still not satisfy with my own work. The apps are "fast" enough, but the development isn't enough "clean". Can you recommend me any real world project, book, or something similar that shows me how a real world swing app work. May be a framework, something structured, etc. For example, i'm thinking i may code a "window manager" that has all the window of the app in an unified resource, may be cached, etc. I think all those good ideas must be implemented already. Thanks!

    Read the article

  • better understanding of JSF Life cycle

    - by gurupriyan.e
    I need your help to understand this better. This is my case. I have a custom validator for each of my input controls in the form. So when there is any validation error,I add a corresponding FacesMessage in the validate method. My understanding was that when there is any validation error - or when there are any FacesMessages added in the validate method of the Custom Validator, it would skip the INVOKE APPLICATION phase and would directly call the RENDER RESPONSE PHASE - showing the FacesMessage that was added in the PROCESS VALIDATION Phase - Is this correct? The problem I'm facing is - I add a FacesMessage in the PROCESS VALIDATION Phase - because of a validation error - and I add a confirmation message for the action that was taken by the user in the INVOKE APPLICATION PHASE - Now both are shown in the page in the RENDER RESPONSE Phase ? - If my understanding is correct in the above question - is it the best practice to conditionally add a confirmation FacesMessage after confirming that there are no FacesMessages in the currect FacesContext ? Appreciate your help.

    Read the article

  • Building a life-critical System using Agile

    - by Ben Breen
    Looking at the general trend of comments in my question about Building an Aircraft using Agile, the biggest problem other than cost appears to be safety. Do people feel that it is not possible to build a safe system (or prove it is safe) using agile? Doesn’t all the iterative testing mitigate this? Is it likely that a piece of software developed using agile will never be as reliable as counterparts such as waterfall?

    Read the article

  • Real life example fo Floating Point error

    - by Rob
    Is there any examples of a company that was burned by floating point data that caused a rounding issue? We're implementing a new system and all the monetary values are stored in floats. I think if i can show actual examples of why this has failed it'll have more weight than the theory of why the values can't be stored properly.

    Read the article

  • ASP.Net Typed Datasets life span

    - by JBeckton
    What happens to a dataset when your done using it. For example if I create and fill a dataset for a grid, when the user leaves that page or logs out I assume the dataset is still in memory? Does each user get their own instance of the dataset? In other words, if 2 users hit the same page that uses a grid are they each served their own instance of the dataset from server memory?

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >