storage

Save user object in Session Storage

落爺英雄遲暮 提交于 2019-12-05 03:02:08
I am using Angular 2 and Typescript and wanted to save the user object like a global variable so it hasn't to be retrieved multiple times. I found the session storage and now save the user object there. Do you think it is good practice to store it there or is the data too sensitve? If so, what other kind of cache could I use? Here is the code I use right now: user.service.ts: getProfile() { let cached: any; if (cached = sessionStorage.getItem(this._baseUrl)) { return Observable.of(JSON.parse(cached)); } else { return this.http.get(this._baseUrl).map((response: Response) => { sessionStorage

Generate disk usage graphs/charts with CLI only tools in Linux

孤者浪人 提交于 2019-12-05 02:13:12
In this question someone asked for ways to display disk usage in Linux. I'd like to take this one step further down the cli-path... how about a shell script that takes the output from something like a reasonable answer to the previous question and generates a graph/chart from it (output in a png file or something)? This may be a bit too much code to ask for in a regular question, but my guess is that someone already has a oneliner laying around somewhere... I would recommend munin . It is designed for exactly this sort of thing - graphing CPU usage, memory usage, disc-usage and such. sort of

Where is Android Emulator Internal Storage

我与影子孤独终老i 提交于 2019-12-05 01:52:32
I have an error due to the contents of a file stored in internal storage on my Android Emulator. (I wrote it to file). Is there a way I can view the internal storage used by my app in windows? I've searched through my whole project folder, sdk, workspace etc and cant find anything. I saw someone in another question say it was in the /data folder, but i dont know where to look for that either. Thanks If you want to view the folder/file structure of the running emulator, you can do that with the Android Device Monitor which is included with the SDK. Specifically, it has a File Explorer, which

Is it a good practice to save a base64 string on the Database?

血红的双手。 提交于 2019-12-05 01:42:35
i'm developing an android application when the user can send a image to my webservice. Currently on my WebService i get a Base64 string and save it in a table on my database. My question: Is that a good practice? Because as far as i know the Base64 string is a heavy string. My concern is about the db performance, like when this table gets bigger than 10000...100000 records. Or should i avoid this behavior? Eg.: Isntead off store the Base64 string on the database, i could recover the image and save only the URL at my db. Ps: The database is SqlServer Thanks for the help guys MusicsCordova To

React Native AsyncStorage storing values other than strings

爷,独闯天下 提交于 2019-12-04 22:15:29
Is there any way to store values other than strings with AsyncStorage? I want to store simple boolean values for example. AsyncStorage.setItem('key', 'ok'); Is no problem, but: AsyncStorage.setItem('key', false); Does not work.. G. Hamaide Based on the AsyncStorage React-native docs , I'm afraid you can only store strings.. static setItem(key: string, value: string, callback?: ?(error: ?Error) > => void) Sets value for key and calls callback on completion, along with an Error if there is any. Returns a Promise object. You might want to try and have a look at third party packages. Maybe this

How can I store a data structure such as a Hashmap internally in Android?

≯℡__Kan透↙ 提交于 2019-12-04 20:17:10
问题 In my Android application I'm trying to store a Map structure such as: Map<String, Map<String, String>> using internal storage. I've looked into using SharedPreferences , but as you know, this only works when storing primitive data types. I tried to use FileOutputStream , but it only lets me write in bytes...Would I need to somehow serialize the Hashmap and then write to file? I've tried reading through http://developer.android.com/guide/topics/data/data-storage.html#filesInternal but I can't

Database entries modification history

穿精又带淫゛_ 提交于 2019-12-04 19:41:57
I am currently working on a big management system (in PHP using Zend Framework, but that is not really revelant of the solution to this question) in which I have to manage multiple entries. Each entry has many fields and span on two tables in a 1-to-many relationship (through a single foreign key). There is roughly 50 fields in the first table and 30 fields in the second one. I am now at the stage to implement a history tracking of the different modifications made by users (and some automated tasks). Each entry might enventually be rolled back partially or totally to a previous value. I was

Back up AppEngine database (Google cloud storage?)

核能气质少年 提交于 2019-12-04 18:14:24
问题 I have an AppEngine application that currently has about 15GB of data, and it seems to me that it is impractical to use the current AppEngine bulk loader tools to back up datasets of this size. Therefore, I am starting to investigate other ways of backing up, and would be interested in hearing about practical solutions that people may have used for backing up their AppEngine Data. As an aside, I am starting to think that the Google Cloud Storage might be a good choice. I am curious to know if

Issue with NSSearchPathForDirectoriesInDomains And Persistent Data

时光怂恿深爱的人放手 提交于 2019-12-04 16:53:53
As suggested, we're using the following code to retrieve the user document's path NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; we get the following path as as result: /var/mobile/Applications/3E3C1F45-6649-4EA3-93FD-CDB802E346EC/Documents/ In said path, we save all the user's persistent data. We encountered some problem with users who upgraded the application's version from the app-store, the persistent data is no longed read, perhaps the path is changed, maybe a new GUID is used within

Preserving login session across multiple Android apps

浪子不回头ぞ 提交于 2019-12-04 16:28:39
I have two apps that both log in to the same system but they have separate functions and may not both be installed at the same time. I can sign the two apps with the same signature no problem, even make them run in the same process. How can I store the login cookie (among other things) in such a way that it is shared by both apps and still be secured from unknown apps? Shared user ID should get you access to each other's private storage, you would just need to figure out if the other was already installed, figure out the absolute path to its private storage and then look and see if it had the