storage

solidity开发以太坊智能合约时memory和storage的不同

为君一笑 提交于 2019-12-05 12:21:11
在使用solidity开发以太坊智能合约时,可以为变量声明memory和storage关键字。那么,它们有什么不同之处?如果在声明合约变量时没有使用memory关键字,Solidity会尝试在storage中存储这个变量。 storage是什么 根据Solidity首席工程师Chriseth的说法: “你可以把storage想像成一个大数组,它有自己的结构,这个结构是由你的合约中的状态变量所决定的,因此在运行时不能改变” 。 这就是说,storage的结构是在合约部署创建时,根据你的合约中状态变量的声明,就固定下来了,并且不能在将来的合约方法调用中改变这个结构。但是,storage中的内容是可以通过交易来改变的。这些交易调用因此将修改合约的状态,这也是为什么合约中的变量被称为状态变量的原因。因此在合约层面声明的一个uint8类型的storage变量, 它的值可以修改为任何0-255之间的有效uint8值,但是该变量在storage结构中的位置始终不会变化。 函数中的变量 如果你在合约函数中声明变量时没有使用memory关键字,那么solidity将会尝试使用storage结构,目前来讲,这样做可以通过编译,但是可能导致不可预期的结果。memory关键字告诉solidity应当在该函数运行时为变量创建一块空间,使其大小和结构满足函数运行的需要。

Using external storage, getting error while deleting a folder

☆樱花仙子☆ 提交于 2019-12-05 11:13:33
I'm using docker nextcloud. I created a clean instance and I want to use the application external storage. I managed to configure successfully a local storage using the following command : mount_id=$(docker exec --user 1000 nextcloud php occ files_external:create Home local null::null -c datadir=/var/www/data --output=json) docker exec --user 1000 nextcloud php occ files_external:applicable --add-user=foo "$mount_id" I can create/move/copy folder and files but when I want to delete a created folder I got the following error : Error deleting file "folderfoo". It's says it's a file but actually

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

混江龙づ霸主 提交于 2019-12-05 10:25:17
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 blob storage to represent the position in a hierarchy of the file, see: Windows Azure: How to create

How to create hidden directory in android?

不打扰是莪最后的温柔 提交于 2019-12-05 09:46:46
I am working on an application where I have created some directory which I am accessing through my application I want to make that directory hidden for security purpose .Such that the user can access them only within the application does not access them outside the application as like through file manager. Any help is appreciated. Don't make it duplicate because I search out all the answer, but no one has worked for me. schrej Just appending a dot before the folder name will not protect it . It is only invisible to the user. It can still be accessed from apps, including file managers and

How can I prove to an outside party that a data file hasn't been tampered with?

梦想与她 提交于 2019-12-05 09:07:59
问题 We have a C#-based web service that receives documents from political organizations which are legally binding documents. Currently, we provide a receipt to the filer which contains a checksum of the file received, so we can prove to the filer at a later point in time that the file stored in our system matches their original submission. The receipt is sent as an e-mail to the filer. However, we can't prove to a third-party auditor that the file and checksum stored in our system have never

When exactly is a thread_local variable declared at global scope initialized?

北城以北 提交于 2019-12-05 08:48:04
For example: #include <thread> thread_local int n = 1; void f() { ++n; // is n initialized here for each thread or prior to entering f()? } int main() { std::thread ta(f); std::thread tb(f); ta.join(); tb.join(); } It's still not entirely clear from here when is n initialized. Simple enough, and all according to specification. n is going to be initialized whenever the new thread is run - before you enter any thread-specific functions. To be exact, it is going to be initialized three times. 来源: https://stackoverflow.com/questions/35508133/when-exactly-is-a-thread-local-variable-declared-at

Make directories in files internal storage

与世无争的帅哥 提交于 2019-12-05 07:51:19
问题 How do i make directories in internal storage? I tried this: File file = getFilesDir(); this makes me goes to folder "/data/data/com.mypackages/files/" Then i want to make a folder again in that directories, let's say i want to make "myfiles" folder in there so it becomes, "/data/data/com.mypackages/files/myfiles/". Can anyone tell me how? I also tried this: File file = getDir("myfiles", MODE_PRIVATE); It makes the folder, but it was created with "app_", so the directories becomes "/data/data

App install size the same on different device types

会有一股神秘感。 提交于 2019-12-05 06:34:50
When I install my app on my main/new phone, the installed size is around 18.5MB and when I install my app on an old Samsung Galaxy Ace (Mk1), for some reason, it installs with pretty much the same size, as you see here: It runs perfectly on my main phone, but obviously, the old Galaxy Ace really struggles with it. Now, I download a random game from the Play Store and with that one you can see the results here: Much better, it takes up less space on the less capable phone than it does on the more capable phone. However, my question is, where can I start to try to figure out why my app doesn't

Spark: Not enough space to cache red in container while still a lot of total storage memory

耗尽温柔 提交于 2019-12-05 04:20:19
问题 I have a 30 node cluster, each node has 32 core, 240 G memory (AWS cr1.8xlarge instance). I have the following configurations: --driver-memory 200g --driver-cores 30 --executor-memory 70g --executor-cores 8 --num-executors 90 I can see from the job tracker that I still have a lot of total storage memory left, but in one of the containers, I got the following message saying Storage limit = 28.3 GB. I am wondering where does this 28.3 GB came from? My memoryFraction for storage is 0.45 And how

What are some Security holes a website is exposed through document upload?

为君一笑 提交于 2019-12-05 03:55:16
问题 I am new to the document storage space. I am not sure what i am doing yet, but before i begin i wanted to know about the possible security threats one has when one allows document uploads and what is the best way to sanitize the data? I am using PHP and will allow images, word docs, pdfs, excel docs, etc. And is this a good solution: http://blog.insicdesigns.com/2009/01/secure-file-upload-in-php-web-applications/ 回答1: There are two really obvious ones: If improperly done, a file uploader