persistent-storage

Using a JSON file to store a small database persistently, in javascript

馋奶兔 提交于 2019-12-24 00:53:14
问题 I am new to the use of JSON. I want my webpage to display, in a table, a small database of a few hundred records. Wanting to avoid the hassle of putting my data in a MySQL database or something similar, I figured I would read my data from a JSON file, and write it out to a JSON file, and that this would amount to convenient, persistent storage of my database at my website. So I spent a bit of time writing a script that translated my existing papers file into a papers.json file that contains

Storing objects between requests in PHP without serialising

孤街醉人 提交于 2019-12-23 17:34:56
问题 I am writing a stateful web application in PHP in which the state potentially contains lots of objects. At this moment, I am keeping all these objects in $_SESSION and have them serialised at the end of the request. This is a bit of a pain, because serialising the entire session takes seconds, and unserialising it takes even more time. I wanted to try APC, because I hoped that the objects are then just being memcopied, instead of serialised. Alas, it seems that if I feed apc_store($object) an

How to clean up memory in WT?

穿精又带淫゛_ 提交于 2019-12-23 17:13:40
问题 UPDATE 3/27/2013 It would appear that I am not leaking memory, it is just WT not keeping a persistent session every time F5 is hit, or a new user connects. Basically the old session gets deleted, and a new one is made every time F5 is hit, or a new user connects from another machine. I have read some parts of the documentation that mention making the session persistent, so when a user reloads the page, or a different user connects they all see the same content. However, I have not been able

Alternative to Windows Azure tables out of the cloud

安稳与你 提交于 2019-12-22 14:05:13
问题 I'm developing a .NET app, which needs to run both on Azure and on regular Windows Servers(2003). It needs to store a few GB of data and SQL Azure is too expensive for me, so I'll use Azure tables in the cloud version. Can you recommend a storage solution, which will run on standalone servers and have an API and behavior similar to Azure tables? From what I've seen Server AppFabric does not include Tables. 回答1: If you think what Windows Azure Table Storage is, it is a Key-Value pair based non

How to Save Data When Using One ManagedObjectContext and PersistentStoreCoordinator with Two Stores

瘦欲@ 提交于 2019-12-22 10:35:50
问题 PROBLEM STATEMENT When attempting to save a record to a read/write store that is one of two SQLite stores assigned to the same PersistentStoreCoordinator, my iPhone app crashes. One obvious issue when saving a record is the PersistentStoreCoordinator does not know in which Store to save the data (only because I don't know how to make this happen). First I will provide the big picture to make sure my approach is sound. Then I will supply the implementation details. BACKGROUND This is a

Shelve module in python not working: “db type cannot be determined”

元气小坏坏 提交于 2019-12-22 05:32:01
问题 I am trying to make a simple password-storing program in Python, and it seems pretty simple so I am wondering if I am using shelve wrong. I have the main .py file: import shelve passwords = shelve.open('./passwords_dict.py') choice = raw_input("Add password (a) or choose site (c)?") if choice[0] == 'a': site_key = raw_input("Add for which site? ").lower() userpass = raw_input("Add any info such as username, email, or passwords: ") passwords[site_key] = userpass else: site = raw_input("Which

Delete Persistent Object when app is Deleted in Blackberry

梦想的初衷 提交于 2019-12-20 03:33:09
问题 I am using persistent object in blackberry to store config details specific to the app. Here is how I am implementing the class public class Preferences implements Persistable { private static PersistentObject persistentObject = PersistentStore.getPersistentObject(0x2759d6ff72264bdbL); private static Hashtable tbl = new Hashtable(); public static void storeLoginToken(String token) { token = removeCharAt(token,0); token = removeCharAt(token,token.length()-1); tbl.put("token", token);

Which persistent store is used by default in core data in iPhone

时光毁灭记忆、已成空白 提交于 2019-12-18 16:11:31
问题 I am creating multiple persistent store in my application, but I am using only one persistent store coordinator and managed object model. Now my question is when I call save method on managed object context, which persistent store it will use to save the object. So I want to specify the persistent store to be used to save the object. Same while fetching the objects from database, I want to ensure that my fetch query should be executed on a particular store so that I get objects from that

How to clear/reset all CoreData in one-to-many relationship

家住魔仙堡 提交于 2019-12-17 16:41:39
问题 I am using coreData, with one -to-many realtionship, I have a folder entity and a file entity. A folder can have many files and so on. So, I have two ViewControllers, FolderViewController and FileViewController which contains folders and files respectively.Now I have a modalView , which is accesible from both folder and file viewcontroller. In this VC I have a button to Reset all Data. So when I click this I want all the data should reset. I used this code,this function is written in

Saving dynamically added LinearLayouts without using savedInstanceState?

馋奶兔 提交于 2019-12-13 04:37:58
问题 I have a layout in which I have dynamically added custom views at a push of a button. These layouts extend LinearLayout and each carry their own unique Action objects. The views will disappear, however, if onCreate is called again, when the user navigates away or rotates the screen. I want to keep these custom ActionHolder views there. To add to the problem, the ActionHolder objects contain sensitive information. The Action objects themselves store a live timer(that is supposed to keep on