storage

Is there a way to do symbolic links to the blob data when using Azure Storage to avoid duplicate blobs?

心已入冬 提交于 2020-01-13 10:22:22
问题 I have a situation where a user is attaching files within an application, these files are then persisted to Azure Blob storage, there is a reasonable likelihood that there are going to be duplicates and I want to put in place a solution where duplicate blobs are avoided. My first thought is to just name the blob as filename_hash but that only captures a subset of duplicates, then filesize_hash was then next thought. In doing this though it seems like I am losing some of the flexibility of the

Issue with NSSearchPathForDirectoriesInDomains And Persistent Data

▼魔方 西西 提交于 2020-01-13 05:43:09
问题 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

Android: how to delete internal image file

我与影子孤独终老i 提交于 2020-01-12 05:10:29
问题 What i want to do: delete an image file from the private internal storage in my app. I save images in internal storage so they are deleted on app uninstall. I have successfully created and saved: String imageName = System.currentTimeMillis() + ".jpeg"; FileOutputStream fos = openFileOutput(imageName, Context.MODE_PRIVATE); bitmap.compress(Bitmap.CompressFormat.JPEG, 35, fos); an image that i receive through bitmap = BitmapFactory.decodeStream(inputStream); I am able to retrieve the image

How to use StorageStatsManager.queryStatsForPackage on Android O?

五迷三道 提交于 2020-01-11 06:55:31
问题 Background Before Android O, in order to get an app size, you had to have a special permission for it, and use a hidden API. The problem Such a solution won't work anymore, but instead, Google provides an official API that's less granular: queryStatsForPackage , which returns StorageStats object. However, I can't find any information of how to use it. As opposed to the hidden API, which only required the package name of the app, this one also requires "String volumeUuid" and "UserHandle user"

chrome.storage is undefined in chrome extension

醉酒当歌 提交于 2020-01-11 02:05:47
问题 I'm developing a Google Chrome extension, and have been working on one for a while. So it's been installed for a while, and I updated the manifest file to include the "storage" permission and reloaded the extension. However, when I try it in the console, chrome.storage is undefined . I restarted Chrome and still nothing. My manifest file looks like this: { ... snip ... "permissions": [ "tabs", "http://*/*", "https://*/*", "chrome://favicon/", "storage" ] } I could reinstall the application,

Android 5.0 DocumentFile from tree URI

江枫思渺然 提交于 2020-01-09 09:39:49
问题 Alright, I've searched and searched and no one has my exact answer, or I missed it. I'm having my users select a directory by: Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE); startActivityForResult(intent, READ_REQUEST_CODE); In my activity I want to capture the actual path, which seems to be impossible. protected void onActivityResult(int requestCode, int resultCode, Intent intent){ super.onActivityResult(requestCode, resultCode, intent); if (resultCode == RESULT_OK) { if

How to find the amount of free storage (disk space) left on Android?

旧巷老猫 提交于 2020-01-09 04:39:05
问题 I am trying to figure out the available disk space on the Android phone running my application. Is there a way to do this programmatically? Thanks, 回答1: Try StatFs.getAvailableBlocks. You'll need to convert the block count to KB with getBlockSize. 回答2: Example: Getting human readable size like 1 Gb String memory = bytesToHuman(totalMemory()) /************************************************************************************************* Returns size in bytes. If you need calculate external

What column type/length should I use for storing a Bcrypt hashed password in a Database?

↘锁芯ラ 提交于 2020-01-08 09:32:13
问题 I want to store a hashed password (using BCrypt) in a database. What would be a good type for this, and which would be the correct length? Are passwords hashed with BCrypt always of same length? EDIT Example hash: $2a$10$KssILxWNR6k62B7yiX0GAe2Q7wwHlrzhF3LqtVvpyvHZf0MwvNfVu After hashing some passwords, it seems that BCrypt always generates 60 character hashes. EDIT 2 Sorry for not mentioning the implementation. I am using jBCrypt. 回答1: The modular crypt format for bcrypt consists of $2$ ,

What column type/length should I use for storing a Bcrypt hashed password in a Database?

夙愿已清 提交于 2020-01-08 09:32:07
问题 I want to store a hashed password (using BCrypt) in a database. What would be a good type for this, and which would be the correct length? Are passwords hashed with BCrypt always of same length? EDIT Example hash: $2a$10$KssILxWNR6k62B7yiX0GAe2Q7wwHlrzhF3LqtVvpyvHZf0MwvNfVu After hashing some passwords, it seems that BCrypt always generates 60 character hashes. EDIT 2 Sorry for not mentioning the implementation. I am using jBCrypt. 回答1: The modular crypt format for bcrypt consists of $2$ ,

C++ Reading and storing information from file

a 夏天 提交于 2020-01-07 08:22:13
问题 I have a text file that has the following data for a simple entry/exit system: where each line has {time_stamp} {name} {door_entry} {status} time_stamp - number of seconds since some arbitrary start time name - The workers username door_entry - door number entered/exited status - whether they entered or exited the door The text file is large and has about 10,000 entries similar to this Question: I'm wondering how I can decompose each line and split each piece of information into a variable.