Search Results

Search found 15698 results on 628 pages for 'keep alive'.

Page 42/628 | < Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >

  • How long do you keep session cookies around for?

    - by user246114
    Hi, I'm implementing a web app, which uses sessions. I'm using GWT and app engine as my client/server, but I don't think they're doing anything really different than I would do with PHP and apache etc. When a user logs into my web app, I am using HttpSession to start a session for them. I get the session id like this: // From my login servlet: getThreadLocalRequest().getSession(false).getId(); I return the sessionId back to the client, and they store it in a cookie. The tutorial I'm using sets this cookie to 'expire' in two weeks: Cookie.write("sid", theSessionId, 1000 * 60 * 60 * 24 * 14); // two weeks Here's where I'm confused: if the cookie expires in two weeks, then my user will go along using the webapp happily, only to one day browse to my site and be shown a login screen. What are my options? Can I just set no expiration time for this cookie? That way the user would have to explicitly log out, otherwise they could just use the app forever without having to log back in? Or is there a better way to do this? I can't remember sites like Twitter having ever asked me to log back in again. I seem to be permanently logged in. Do they just set no expiration? The webapp isn't protecting any sort of highly sensitive data, so I don't mind leaving a cookie that doesn't expire, but it seems like there must be a better way? This is the tutorial I'm referencing: http://code.google.com/p/google-web-toolkit-incubator/wiki/LoginSecurityFAQ Thanks

    Read the article

  • How should my application keep clients in sync with schema changes to HTML5 databases?

    - by Chad Johnson
    I'm wanting to incorporate HTML5 database storage into my web application to make it online-accessible. I've done lots of development in server-side environments with databases, and we all know that database schema additions and modifications are often necessary. I am wondering what should happen if my application uses an offline database schema, and that schema changes. How do I prevent the application from breaking on the client side? How do I ensure the database is always up to date on the client end? Anyone have any solutions?

    Read the article

  • Keep a reference to an NSThread around and message its objects?

    - by RickiG
    Hi I am a bit uncertain on how to do this: I start a "worker-thread" that runs for the duration of my apps "life". [NSThread detachNewThreadSelector:@selector(updateModel) toTarget:self withObject:nil]; then - (void) updateModel { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; BackgroundUpdate *update = [[BackgroundUpdate alloc] initWithTimerInterval:5]; [[NSRunLoop currentRunLoop] run]; //keeps it going 'forever' [update release]; [pool release]; } Now the thread "wakes" up every 5 seconds(initWithTimerInterval) to see if there are any tasks it can do. All the tasks in the BackGroundUpdate Class are only time dependent for now. I would like to have a few that were "event dependent". e.g. I would like to call the Background Object from my main thread and tell it to "speedUp", "slowDown", "reset" or any method on the object. To do this I guess I need something like performSelectorOnThread but how to get a reference to the NSthread and the Background Object?

    Read the article

  • WPF/MVVM - keep ViewModels in application component or separate?

    - by Anders Juul
    Hi all, I have a WPF application where I'm using the MVVM pattern. I get the VM activated for actions that require user input and thus need to activate views from the VM. I've started out separating the VMs into a separate component/assembly, partly because I see them as the unit testable part, partly because views should rely on VM, not the other way round. But when I then need to bring up a window, the window is not known by the VM. All introductions I find place the VM in the WPF/App component, thus eliminating the problem. This article recommends keeping them in separate layers : http://waf.codeplex.com/wikipage?title=Architecture%20-%20Get%20The%20Big%20Picture&referringTitle=Home As I see it, I have the following choices Move VMs to the WPF/App assembly to allow VMs to access the windows directly. Place interfaces of views in VM-assembly, implement views in WPF/App assembly and register the connection through IOC or alternative ways. File a 'request' from the VM into some mechanism/bus that routes the request (but which mechanism!? E.g something in Prism?!) What's the recommendation? Thanks for any comments, Anders, Denmark

    Read the article

  • How to keep confirmation messages after POST while doing a post-submit redirect?

    - by MicE
    Hello, I'm looking for advise on how to share certain bits of data (i.e. post-submit confirmation messages) between individual requests in a web application. Let me explain: Current approach: user submits an add/edit form for a resource if there were no errors, user is shown a confirmation with links to: submit a new resource (for "add" form) view the submitted/edited resource view all resources (one step above in hierarchy) user then has to click on one of the three links to proceed (i.e. to the page "above") Progmatically, the form and its confirmation page are one set of classes. The page above that is another. They can technically share code, but at the moment they are both independent during processing of individual requests. We would like to amend the above as follows: user submits an add/edit form for a resource if there were no errors, the user is redirected to the page with all resources (one step above in hierarchy) with one or more confirmation messages displayed at the top of the page (i.e. success message, to whom was the request assigned, etc) This will: save users one click (they have to go through a lot of these add/edit forms) the post-submit redirect will address common problems with browser refresh / back-buttons What approach would you recommend for sharing data needed for the confirmation messages between the two requests, please? I'm not sure if it helps, it's a PHP application backed by a RESTful API, but I think that this is a language-agnostic question. A few simple solutions that come to mind are to share the data via cookies or in the session, this however breaks statelessness and would pose a significant problem for users who work in several tabs (the data could clash together). Passing the data as GET parameters is not suitable as we are talking about several messages which are dynamic (e.g. changing actors, dates). Thanks, M.

    Read the article

  • customizing what files to keep under version control ? [svn]

    - by Neeraj
    Recently, I checked out a copy of a project, There were multiple source files and a manual makefile based build system. I did this svn status No output // meaning . is a working copy make // created a lot of *.o files svn status No change How come this is possible? This clearly suggests there be some wildcard way to customize the files under version control? How can I do that?s

    Read the article

  • How to keep a shell open across multiple ajax requests in PHP?

    - by Joost van Doorn
    I need to use a shell across multiple ajax requests. Basically this means that the next request should be able to continue with the same shell where the other process left off. The purpose is to communicate with daemons like FTP to open an FTP connection and log in and in the next request continue with that connection and be able to use it for uploads. But it's not limited to only the FTP daemon (as I know that FTP is supported in PHP).

    Read the article

  • Ignore carriage returns in scanf before data.... to keep layout of console based graphics with conio

    - by volting
    I have the misfortune of having use conio.h in vc++ 6 for a college assignment, My problem is that my graphic setup is in the center of the screen... e.g. gotoxy( getcols()/2, getrows()/2); printf("Enter something"); scanf( "%d", &something ); now if someone accidentally hits enter before they enter the "something", then the cursor gets reset to the left of the screen on the next line. Iv tried flushing the keyboard and bios buffers with fflush(stdin) and getchar(), which like I expected didn't work! Any help/ideas would be appreciated, Thanks, V

    Read the article

  • Low cost way to host a large table yet keep the performance scalable?

    - by Leo Liang
    I have a growing table storing time series data, 500M entries now, and 200K new records every day. The total size is around 15GB for now. My clients are querying the table via a PHP script mostly, and the size of the result set is around 10K records (not very large). select * from T where timestamp > X and timestamp < Y and additionFilters And I want this operation cheap. Currently my table is hosting in Postgres 7, on a single 16G memory Box, and I would love to see some good suggestion for me to host this in low cost and also allow me to scale up for performance if needed. The table serves: 1. Query: 90% 2. Insert: 9.9% 2. Update: 0.1% <-- very rare.

    Read the article

  • Why does my CGI script keep redirecting links to localhost?

    - by Noah Brainey
    Visit this page http://online-file-sharing.net/tos.html and click one of the bottom footer links. It redirects you to your localhost in the address bar. I have no idea why it does this. This is in the main script that my entire website revolves around: upload.cgi $ENV{PATH} = '/bin:/usr/bin'; delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; ($ENV{DOCUMENT_ROOT}) = ($ENV{DOCUMENT_ROOT} =~ /(.*)/); # untaint. #$ENV{SCRIPT_NAME} = '/cgi-bin/upload.cgi'; use lib './perlmodules'; #use Time::HiRes 'gettimeofday'; #my $hires_start = gettimeofday(); my (%PREF,%TEXT) = (); No file is displayed when someone visits the root directory, although I have a .htaccess file saying to open my upload.cgi file which is located in my root directory. When I point my browser directly to the CGI file it works but it brings me to my localhost again. I'm hosting this website on my own server, which is this computer, and using XAMPP if this information helps. I'm also using DynDNS as my nameservers. I hope you can give me some insight.

    Read the article

  • asp.net 4.0 webforms - how to keep ContentPlaceHolder1_ out of client id's in a simple way?

    - by James Manning
    I'm attempting to introduce master pages to an existing webforms site that's avoided using them because of client id mangling in the past (and me not wanting to deal with the mangling and doing <% foo.ClientID % everywhere :) GOAL: use 'static' id values (whatever is in the server control's id attribute) except for data-bound / repeating controls which would break for those cases and therefore need suffixes or whatever to differentiate (basically, Predictable) Now that the site migrated to ASP.NET 4.0, I first attempted to use ClientIDMode of Static (in the web.config) but that broke too many places doing repeating controls (checkboxes inside gridviews, for instance) since they all resulted with the same id. So, I then tried Predictable (again, just in the web.config) so that the repeating controls wouldn't have conflicting id's, and it works well except that the master page content placeholder (which is indeed a naming container) is still reflecting in the resulting client id's (for instance, ContentPlaceHolder1_someCheckbox). Certainly I could leave the web.config setting as static and then go through all the databound/repeating controls switch them to Predictable, but I'm hoping there's some easier/simpler way to get that effect without having to scatter ClientIDMode attributes in those N number of places (or extend all those databound controls with my own usercontrol that just sets clientidmode, or whatever). I even thought of leaving web.config set to static and doing a master or basepage handler (preinit? not sure if that would work or not) that would go walk Controls with OfType<INamingContainer() (might be a better choice on the type, but that seems like a good starting choice looking at repeater and gridview) and then set those to Predictable so I'd get static for all my 'normal' things outside of repeating controls but not have to deal with static inside things like gridview/repeater/etc. I don't see any way to mark the content placeholder such that it 'opts out' of being included in child id's - setting the ID of the placeholder to empty/blank doesn't work as it's a required attribute :) At that point I figured there was a better/simpler way that I was missing and decided to ask on SO :) Edit: I thought about changing all my 'fetch by id' jquery calls from $('#foo') to fetch_by_id('foo') and then having that function return the 'right one' by checking $('#foo').length and then $('#ContentPlaceHolder1_foo').length (and maybe other patterns) or even just have it return $('#foo, #ContentPlaceHolder1_foo') (again, potentially other patterns) but changing all the places I fetch elements by id seemed pretty ugly too, and I'd like to avoid that abstraction layer if possible to do so easily :)

    Read the article

  • How do you keep track of your programming TODOs?

    - by Simucal
    I'm one of those people who can't get anything done without a to-do list. If it isn't on the list it doesn't exist. Notepad Method: When I'm programming I've been keeping notepad open with a list of to-do's for my current project. I'll constantly re-arrange these based off priority and I cross them off and move them to the completed section when I'm finished with that particular task. Code Comments: Some programmers pepper their projects source code with: // TODO: Fix this completely atrocious code before anyone sees it Plus, I know that there are some tools that show you a list of all TODOs in your code as well. Website Task Tracker: Remember The Milk Backpack Manymoon Voo2do Gmail Tasks TeuxDeux TodoDodo Ta-da lists ... and many more What have you found to be the best method of keeping track of your to-do lists for multiple projects? Related Question: What can someone do to get organized around here? Related Question: Getting Organized; the to-do list.

    Read the article

  • IIS URL Rewriting: How can I reliably keep relative paths when serving multiple files?

    - by NVRAM
    My WebApp is part CMS, and when I serve up an HTML page to the user it typically contains relative paths in a.href and img.src attributes. I currently have them accessed by urls like: ~/get-data.aspx/instance/user/page.html -- where instance indicates the particular instance for the report and "user/page.html" is a path created by an external application that generates the content. This works pretty reliably with code in the application's BeginRequest method that translates the text after ".aspx" into a query string, then uses Context.RewritePath(). So far so good, but I've just tripped over something that took me by surprise: it appears that if any of the query string ("instance/user/page.html") happens to contain a plus sign ("+") the BeginRequest method is never called, and a 404 is immediately returned to the user. So my question is two-fold: Am I correct in my belief that a "+" would cause the 404, and if so are there other things that could cause similar problems? Is there a way around that problem (perhaps a different method than BeginRequest)? Is there a better way to preserve relative URL paths for generated content than what I'm using? I'd rather not require site admins to install a 3rd party rewrite tool if I can help it.

    Read the article

  • How can I keep gnu screen from becoming unresponsive after losing my SSH connection?

    - by Mikey
    I use a VPN tunnel to connect to my work network and then SSH to connect to my work PC running cygwin. Once logged in I can attach to a screen session and everything works great. Now, after a while, I walk away from my computer and sooner or later, the VPN tunnel times out. The SSH connection on each end eventually times out and then I eventually come back to my computer to do some work. Theoretically, this should be a simple matter of just restarting the VPN, reconnecting via SSH, and then running "screen -r -d". However apparently when the sshd daemon times out on the cygwin PC, it leaves the screen session in some kind of hung state. I can reproduce a similar hung state by clicking the close box on a cygwin bash shell window while it's running a screen session. Is there any way to get the screen session to recover once this has happened, so that I don't lose anything?

    Read the article

  • Do I need to keep "recompiling" my iPhone app code everytime apple releases a new iOS version?

    - by user1760606
    New here guys but have got a genuine problem. I have an iPhone app that was developed using SDK4. With apple introducing the new iOS version 6, does my code need to be recompiled on the new SDK to make it compatible with version 6? Right now it crashes on iOS6. Also, do I need to do that everytime apple brings out a new version? I wonder every other app on earth already does that ?! Thanks, Raghav

    Read the article

  • How to change the number of columns in a table dynamically but still keep the table layout intact?

    - by gurupriyan.e
    I have a 'n' column table , the first column is a drop down box , on selecting the options from the drop down, the other columns change. For eg: first drop down might need to display a text box and a button , the second drop down 3 text boxes and a button and so on. There is only one row in the table. What is the best solution to achieve this. with Sincere thanks,

    Read the article

  • Is there a way to keep a selenium session persistent accross multiple tests?

    - by Nick
    I am testing a django application's frontend with selenium and that's first time I use it. I have multiple tests that test things after user logged in. I want them to be separate tests, but I want to have only log in once, is that possible? (As oppose to what I do right now: I log in first, then execute my testing actions of test1, then log in again and execute my testing actions for test2, etc.)

    Read the article

  • What's the best way to keep java app data stored redundantly in a file?

    - by Bijan
    If I have systems that are based on realtime data, how can I ensure that all the information that is current is redundantly stored in a file? So that when the program starts again, it uses this information to initialize itself back to where it was when it closed. I know of xstream and HSQLDB. but wasn't sure if this was the best option for data that needs to be a literal carbon copy.

    Read the article

  • How can I pass query string variables with NavigationService.Navigate?

    - by Mike Hildner
    Greetings, Searched for this, but no luck. I'm attempting to pass query string variables (and then retrieve them) in my Silverlight 4 app. First I tried this this.NavigationService.Navigate(new Uri("/LoanProductionRegion?Elvis=Alive&ImHungry=true", UriKind.Relative)); But HtmlPage.Document.QueryString doesn't pick them up because they come after the anchor (the full url looks like http://localhost:1076/Dashboard.SLTestPage.aspx#/LoanProductionRegion?Elvis=Alive&ImHungry=true). I tried to put the vars in front, such as this.NavigationService.Navigate(new Uri("?Elvis=Alive&ImHungry=true/LoanProductionRegion", UriKind.Relative)); this.NavigationService.Navigate(new Uri("/?Elvis=Alive&ImHungry=true/LoanProductionRegion", UriKind.Relative)); But both result in a "Page not found" error. Anyone know how to achieve what I'm after?

    Read the article

  • How can I keep an event from being delivered to the GUI until my code finished running?

    - by Frerich Raabe
    I installed a global mouse hook function like this: mouseEventHook = ::SetWindowsHookEx( WH_MOUSE_LL, mouseEventHookFn, thisModule, 0 ); The hook function looks like this: RESULT CALLBACK mouseEventHookFn( int code, WPARAM wParam, LPARAM lParam ) { if ( code == HC_ACTION ) { PMSLLHOOKSTRUCT mi = (PMSLLHOOKSTRUCT)lParam; // .. do interesting stuff .. } return ::CallNextHookEx( mouseEventHook, code, wParam, lParam ); } Now, my problem is that I cannot control how long the 'do interesting stuff' part takes exactly. In particular, it might take longer than the LowLevelHooksTimeout defined in the Windows registry. This means that, at least on Windows XP, the system no longer delivers mouse events to my hook function. I'd like to avoid this, but at the same time I need the 'do interesting stuff' part to happen before the target GUI receives the event. I attempted to solve this by doing the 'interesting stuff' work in a separate thread so that the mouseEventHookFn above can post a message to the worker thread and then do a return 1; immediately (which ends the hook function but avoids that the event is handed to the GUI). The idea was that the worker thread, when finished, performs the CallNextHookEx call itself. However, this causes a crash inside of CallNextHookEx (in fact, the crash occurs inside an internal function called PhkNextValid. I assume it's not safe to call CallNextHookEx from outside a hook function, is this true? If so, does anybody else know how I can run code (which needs to interact with the GUI thread of an application) before the GUI receives the event and avoid that my hook function blocks too long?

    Read the article

  • How do I keep from running out of memory on graphics for an Android app?

    - by user279112
    I've been working on an Android app in Eclipse, and so far, my program hasn't really grown past midget size. However I've already run into an issue with an Out of Memory error. You see, I've been using graphics comprised solely of bitmaps and PNGs in this program, and recently, when I tried to add a little bit more functionality to the program (mainly including a few more bitmaps and causing an extra sprite to be created), it started crashing in the graphics thread's constructor - sprite's constructor. When I tracked the problem down, it turned out to be an Out of Memory error that is seemingly caused by adding too many picture files to the program and creating Drawables out of them. This would be a problem, as I really don't have that many picture resources worked into that program...maybe 20 or so. I haven't even started to include sound yet. These images aren't all that fancy. My questions are this: 1) Are programs for the Android phone really that limited on how much memory they can employ, or is it probably something other than the 20-30 resource pictures causing that error? 2) If the memory for Android apps is so awful it can't even handle 20-30 picture resources being loaded into Drawables that exist at the same time, then how in the world are you supposed to make decent graphics and sound for that thing? Thanks.

    Read the article

  • How to keep form items selected after post request?

    - by Ole Jak
    I have a simple html form. On php page. A simple list is placed on form. I submit this form (selected list items) to this page so it gives me page refresh. I want items which were POSTED to be selected after form was submited. How to do such thing? For my form I use such code: <form action="FormPage.php" method="post"> <select id="Streams" class="multiselect ui-widget-content ui-corner-all" multiple="multiple" name="Streams[]"> <?php $query = " SELECT s.streamId, s.userId, u.username FROM streams AS s JOIN user AS u ON s.userId = u.id LIMIT 0 , 30 "; $streams_set = mysql_query($query, $connection); confirm_query($streams_set); $streams_count = mysql_num_rows($streams_set); while ($row = mysql_fetch_array($streams_set)){ echo '<option value="' , $row['streamId'] , '"> ' , $row['username'] , ' (' , $row['streamId'] ,')' ,'</option> '; } ?> </select> <br/> <input type="submit" class="ui-state-default ui-corner-all" name="submitForm" id="submitForm" value="Play Stream from selected URL's!"/> </fieldset> </form>

    Read the article

  • How can I keep data that a user has entered in my jQuery/Ajax pop-up form?

    - by Lucas McCoy
    I have a form on a website I'm working (you can see it here) on that allows my users to give feedback. It's an jQuery/Ajax popup form: $('.contact_us').click(function(){ var boxy_content; boxy_content += "<div style=\"width:300px; height:300px \"><form id=\"feedbacked\">"; boxy_content += "<p>Subject<br /><input type=\"text\" name=\"subject\" id=\"subject\" size=\"33\" /></p><p>Your E-Mail Address:<br /><input type=\"text\" name=\"your_email\" size=\"33\" /></p><p>Comment:<br /><textarea name=\"comment\" id=\"comment\" cols=\"33\" rows=\"5\"></textarea></p><br /><input type=\"submit\" name=\"submit\" value=\"Send >>\" />"; boxy_content += "</form></div>"; // Other code here... Is there anyway I can save what the user has entered (in case they see our error message when they try to submit)?

    Read the article

  • OpenGL ES - how to keep some object at a fixed size?

    - by OMH
    I'm working on a little game in OpenGL ES. In the background, there is a world/map. The map is just a large texture. Zoom/pinch/pan is used to move around. And I'm using glOrthof (left, right, bottom, top, zNear, zFar) to implement the zoom/pinch. When I zoom in, the sprites on top of the map is also zoomed in. But I would like to have some sprites stay at a fixed size. I could probably calculate a scale factor, depending on the parameters to glOrthof, but there must be a more natural and straightforward way of doing that, instead of scaling the sprites down when I zoom in. If I add some text or some GUI elements on top of the map, they should definately have a fixed size. Is there a solution to do this, or do I have to leave fixed values in glOrthof and implement zoom/pinch in another way? EDIT: To be more clear: I want sprites that zoom in/out along with the map, but stay at the same size. I have some elements that are like the pins on the iPhone's map application. When you zoom, the pins stay the same size, but move around on the screen to stay on the same spot on the map. That is mainly what I want a solution for. Solutions for this already came below, thanks!

    Read the article

< Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >