data-integrity

Can the data=journal mode of EXT4 avoid user data loss?

筅森魡賤 提交于 2021-02-11 14:25:20
问题 journal mode data=journal mode provides full data and metadata journaling. All new data is written to the journal first, and then to its final location. In the event of a crash, the journal can be replayed, bringing both data and metadata into a consistent state. This mode is the slowest except when data needs to be read from and written to disk at the same time where it outperforms all others modes. Enabling this mode will disable delayed allocation and O_DIRECT support. Here I have a few

Repeated parameter checks in functions

杀马特。学长 韩版系。学妹 提交于 2020-01-14 09:36:31
问题 I often have call hierarchies in that all methods need the same parameters. If I dont't want to put them on the instance level (member of the class) then I ask me always if its meaningfull to check the validity of them in each method. For example: public void MethodA(object o){ if(null == o){ throw new ArgumentNullException("o"); } // Do some thing unrelated to o MethodB(o); // Do some thing unrelated to o } public void MethodB(object o){ if(null == o){ throw new ArgumentNullException("o"); }

tools for downloading software + automatically verifying integrity

心不动则不痛 提交于 2020-01-07 08:36:10
问题 (moved here from a combined question) I'm wondering if there are any software tools projects to: create a standard machine-readable format for publishing a small metadata set = (download link + MD5 hash + optional public key and/or certificate) plus a browser plugin (preferably Firefox) to automatically read that data and assist in the steps of downloading the software, verify the downloaded software's integrity add an entry to a log including this information along with what page the

C++ Is private really private?

时间秒杀一切 提交于 2020-01-02 00:14:33
问题 I was trying out the validity of private access specifier in C++. Here goes: Interface: // class_A.h class A { public: void printX(); private: void actualPrintX(); int x; }; Implementation: // class_A.cpp void A::printX() { actualPrintX(); } void A::actualPrintX() { std::cout << x: } I built this in to a static library (.a/.lib). We now have a class_A.h and classA.a (or classA.lib) pair. I edited class_A.h and removed the private: from it. Now in another classTester.cpp: #include "class_A.h"

Data integrity question when collecting STDOUTs from multiple remote hosts over SSH

断了今生、忘了曾经 提交于 2019-12-25 01:45:35
问题 Suppose you run the following commands: ssh $host1 'while [ 1 ]; do sleep 1; echo "Hello from $HOSTNAME"; done' > /tmp/output ssh $host2 'while [ 1 ]; do sleep 1; echo "Hello from $HOSTNAME"; done' >> /tmp/output ssh $host3 'while [ 1 ]; do sleep 1; echo "Hello from $HOSTNAME"; done' >> /tmp/output Then the output would look like: Hello from host1 Hello from host2 Hello from host3 Hello from host1 ... But what if I changed it to ssh $host1 'while [ 1 ]; do sleep 1; cat /some/large/file1.txt;

How to move object from Amazon S3 to Glacier with Vault Locked enabled?

大兔子大兔子 提交于 2019-12-24 10:54:18
问题 I'm looking for a solution for moving Amazon S3 objects to Glacier with Vault Lock enabled (like described here https://aws.amazon.com/blogs/aws/glacier-vault-lock/). I'd like to use Amazon built in tools for that (lifecycle management or some other) if possible. I cannot find any instructions or options to do that. S3 seems to only allow moving object to Glacier storage class. But that does not provide data integrity nor defends against data loss. I know I could do it with a program. It

Should server side dto validation validate the existance of data or the integrity?

耗尽温柔 提交于 2019-12-24 07:10:44
问题 So far I have always validated my dto`s properties for existing values, min, max, length etc.. Now I have a usecase with my http api where the payload of a http post contains Ids (database foreign keys) which either does not exist in the database or these ids does not belong to the userId inside the bearer token. UserId is always a field in each table. Should I really write a repository Method like: // done with 3 queries still room for optimization... public bool NewTestTypeIsValid(string

Add object and its relationships atomically in SQL Server database

狂风中的少年 提交于 2019-12-21 23:26:12
问题 Suppose I want to insert a new Experiment in my SQL Server database, using Entity framework 4.0: Experiment has 1..* Tasks in it Both Experiment and Task derive from EntityObject Also, there is a database constraint that each Task must have exactly one "parent" Experiment linked to it Insertion must be atomic. What I mean by atomic is that a reader on database must never be able to read an Experiment which is not fully written to database, for instance an Experiment with no Task . All

SQL Server: How to ignore referential integrity until COMMIT?

旧街凉风 提交于 2019-12-21 05:36:17
问题 i have a process to move rows from one database to another. Because of some circular foreign key reference chains i cannot remove the rows from the old database, nor can i insert them into the new database. Since the entire operation happens in a transaction 1 , i want SQL Server to ignore referential integrity failures until i call COMMIT TRANSACTION . For example 2 : Table: Turboencabulators Table: Marselvanes ========================= ======================= PK TurboencabulatorID int /->

Prevent two users from editing the same data

心不动则不痛 提交于 2019-12-19 08:51:18
问题 I have seen a feature in different web applications including Wordpress (not sure?) that warns a user if he/she opens an article/post/page/whatever from the database, while someone else is editing the same data simultaneously. I would like to implement the same feature in my own application and I have given this a bit of thought. Is the following example a good practice on how to do this? It goes a little something like this: 1) User A enters a the editing page for the mysterious article X.