data-loss

Mongo aggregate query results in less document with sorting

随声附和 提交于 2020-05-16 22:40:46
问题 I have faced a weird issue while querying one of our collections and aggregating the result out to another collection. I am querying unique users who have done some action and projecting the count of action performed per user in the aggregation query. var result = db.getCollection('user_actions').aggregate( [ {"$match":{"createdAt":{"$gte":1585161000000,"$lt":1585247340000}}}, {"$group":{"_id":{"accountId":"$user.id"},"count":{"$sum":1}}}, {"$sort": {"count": -1}}, {"$project":{"_id":0,"count

cordova update android version without any loss

Deadly 提交于 2020-01-24 21:47:06
问题 I was trying to update my android version in my cordova project using this command: cordova platform update android But this was the response: Using cordova-fetch for cordova-android@~7.0.0 Updating android project... (node:4188) UnhandledPromiseRejectionWarning: An in-place platform update is not supported. The `platforms` folder is always treated as a build artifact in the CLI workflow. To update your platform, you have to remove, then add your android platform again. Make sure you save

c# serial port data loss

纵然是瞬间 提交于 2020-01-01 19:25:09
问题 I have written a C# program to receive data on COM2 port. The baud rate is set as 115200. The sender is sending the data at 115200bps. My program is losing a few bytes ocassionally. I am calling ReadByte method to read the data in a while(true) loop from the com port. I have few questions: When the baud rate is set high, should I expect to lose data? if yes, why? I am setting the readbuffer size as 100*1024*1024. Does this set the serial driver buffer size to 100*1024*1024? Any thoughts on

Android SQLite Upgrade without losing data

喜你入骨 提交于 2019-12-30 00:38:21
问题 I have created a SQLite database successfully and it works fine. However when the onUpgrade method is called, I'd like to do so without losing data. The app I'm developing is a quiz app. Simply, when the onCreate method is called I create and prepopulate a database with questions, answers etc. The last column is whether they have set the question as a favourite or not. What I would like to do is that when the onUpgrade method is called, I'd like to temporarily save that one column, drop the

json_decode data loss

こ雲淡風輕ζ 提交于 2019-12-23 16:41:56
问题 I have a JSON string (external file) which has an element which can either have FALSE or TRUE as a value. In the file, the true or false IS there. However, after I use json_decode on it, the true or false is lost. Why? The JSON is valid, it is made from many blocks of { "surroundedDebuff":true, "citizenId":108981, "citizenship":19, "berserk":true, "defenderSide":false, "weapon":0, "time":"25-03-2012 16:07:13:442", "damage":65 } (this repeated many times), the checking is a simple print_r. 回答1

Strange git case - git stash followed by git stash apply lost uncommitted data?

◇◆丶佛笑我妖孽 提交于 2019-12-22 06:09:43
问题 I have a file, let's say file.txt I have done git mv file.txt to file1.txt, then I created a new file called file.txt and worked on it. Unfortunately I didn't add that file to git yet. Anyway the problem is that I did git stash, then git stash apply, but the new file.txt disappeared... anyway to get it back? 回答1: The problem here is mostly a misunderstanding of what git stash save does. It saves only changes to tracked files. Untracked files are not saved by git stash . When you moved file

function in dll doesn't receive CString argument value

♀尐吖头ヾ 提交于 2019-12-12 02:34:48
问题 Hi everyone. I have to work with old utility: which converts xls into txt. There was a small problem in logic of the utility, but the problem is in other thing... The utility consists of two parts: exe module and dll module, and uses MFC. In exe project we have pInit = (t_bXR_Init)GetProcAddress(hExcel, _T("bXR_Init")); and pInit("logfiles",false); In dll project we have typedef bool (*t_bXR_Init) (CString const &strlogfilespath, bool btxtfile); XLSREADER_API bool bXR_Init(CString const

SQLite: Multiple Connections to one file - the one and only writable is not persisted

余生颓废 提交于 2019-12-12 02:29:12
问题 We are using the System.Data.SQLite Wrapper in Version 1.0.80. Using this to establish multiple connections to a single SQLite database will show a weird behaviour. We ensure having just one writable connection and multiple read-only connections. When the first established connection is a read-only connection (using the connection string parameter Read Only=true) the second connection (which is writable due to missing read-only parameter) does not persist changes. There are no exceptions

Inkscape - quality loss when using rect with image as pattern compared to just using <image>

这一生的挚爱 提交于 2019-12-11 06:28:41
问题 So basically I use a png image in two different versions. First by just opening it in Inkscape and storing it as svg, for the second by clicking "convert to pattern" and then storing as svg. The first looks like this in the file: <image width="1280" height="720" preserveAspectRatio="none" xlink:href="data:image/png;base64,iVBOR..." id="image10" x="0" y="0" /> and the second like this: <defs id="defs6"> <pattern patternUnits="userSpaceOnUse" width="1280" height="720" id="pattern4157"> <image y

Cassandra is configured to lose 10 seconds of data by default?

随声附和 提交于 2019-12-07 05:09:42
问题 As the data in the Commitlog is flushed to the disk periodically after every 10 seconds (controlled by commitlog_sync_period_in_ms ), so if all replicas crash within 10 seconds, will I lose all that data? Does it mean that, theoretically, a Cassandra Cluster can lose data? 回答1: If a node crashed right before updating the commit log on disk, then yes, you could lose up to ten seconds of data. If you keep multiple replicas, by using a replication factor higher than 1 or have multiple data