corrupt

Better SQLite corruption detection

∥☆過路亽.° 提交于 2019-12-01 05:12:35
At first, some background: My Android app has DB table with a lot of four-column rows. It sends requests to the server and server responds only when all of these four values are "valid". A few of the thousands users reported that something doesn't work for them (since awhile they are not getting the results from the server) - I was trying to figure out what's causing the problem and it turned out that the only possible cause is the DB corruption that's not being detected. In ACRA logs I've got some messages with SQL errors, but these were about application not being able to open the file

git svn rebase: Incomplete data: Delta source ended unexpectedly

半世苍凉 提交于 2019-11-30 17:37:54
I have been maintaining the git mirror of the watir project . Some time a couple weeks ago, we had someone ready to submit their first git-based patch. Unfortunately, we ran into some issues regarding line endings (CRLF vs. LF, etc.) because of the multi-platform nature of the project. I tried what I could to set the autocrlf option (to 'input'), and do some --hard resets. However, a few days later, the daily update (git svn rebase) is spewing this error: Incomplete data: Delta source ended unexpectedly I've tried googling around for what to do, but even removing the autocrlf setting in the

Detect if PNG file is corrupted in Objective C

一笑奈何 提交于 2019-11-30 15:59:17
问题 I'm downloading jpgs and pngs using NSURLRequest. This works ok but sometimes the files are corrupted. I have seen Catching error: Corrupt JPEG data: premature end of data segment and have this working for jpgs. Does anyone know of a way to do the same for pngs? ie Programatically check if the png data is valid... 回答1: The PNG format has several built in checks. Each "chunk" has a CRC32 check, but to check that you'd need to read the full file. A more basic check (not foolproof, of course)

Detect if PNG file is corrupted in Objective C

╄→尐↘猪︶ㄣ 提交于 2019-11-30 15:41:34
I'm downloading jpgs and pngs using NSURLRequest. This works ok but sometimes the files are corrupted. I have seen Catching error: Corrupt JPEG data: premature end of data segment and have this working for jpgs. Does anyone know of a way to do the same for pngs? ie Programatically check if the png data is valid... The PNG format has several built in checks. Each "chunk" has a CRC32 check, but to check that you'd need to read the full file. A more basic check (not foolproof, of course) would be to read the start and ending of the file. The first 8 bytes should always be the following (decimal)

Is there any way to have PHP detect a corrupted image?

江枫思渺然 提交于 2019-11-29 07:28:41
Is there any way to have PHP determine whether an image file is corrupted and will not be able to display properly? I've tried to check with fopen and check whether the URL is valid, but it hasn't worked! Javascript solution (with involving jQuery, though this should be possible to do without it too): <script type='text/javascript'> $(function(){ var files = [ 'warning-large.png', 'warning-large-corrupted.png', 'http://www.example.com/none.gif', 'http://sstatic.net/stackoverflow/img/favicon.ico' ]; for ( var n in files ) { var img = $('<img/>'); img.error(function(){ alert('error:\n' + this

How to recover corrupted Eclipse workspace?

亡梦爱人 提交于 2019-11-28 03:54:18
I just managed to corrupt contents of my Eclipse .metadata directory. Starting up with eclipse -clean did not work out. Deleting .metadata and then importing all projects, plugins and setting does not sound too interesting. I ended up moving .metadata/.plugins/org.eclipse.core.resources/ elsewhere and reimporting my projects only. Are there any tools or best practices to recover workspace? I have some experience at recovering from eclipse when it becomes unstartable for whatever reason, could these blog entries help you? http://blog.chris-alex-thomas.com/2009/08/26/eclipse-refuses-to-start

Is there any way to have PHP detect a corrupted image?

微笑、不失礼 提交于 2019-11-28 01:11:13
问题 Is there any way to have PHP determine whether an image file is corrupted and will not be able to display properly? I've tried to check with fopen and check whether the URL is valid, but it hasn't worked! 回答1: Javascript solution (with involving jQuery, though this should be possible to do without it too): <script type='text/javascript'> $(function(){ var files = [ 'warning-large.png', 'warning-large-corrupted.png', 'http://www.example.com/none.gif', 'http://sstatic.net/stackoverflow/img

How to simulate a corrupt state exception in .NET 4?

℡╲_俬逩灬. 提交于 2019-11-27 23:05:27
Well, in .NET 4 Microsoft added the HandleProcessCorruptedStateExceptions attribute: HandleProcessCorruptedStateExceptionsAttribute Class I want to test this feature. How can I bring my application to a "corrupt state"? Screwing up the garbage collected heap is always a good way: using System; using System.Runtime.InteropServices; class Program { unsafe static void Main(string[] args) { var obj = new byte[1]; var pin = GCHandle.Alloc(obj, GCHandleType.Pinned); byte* p = (byte*)pin.AddrOfPinnedObject(); for (int ix = 0; ix < 256; ++ix) *p-- = 0; GC.Collect(); // kaboom } } Just dereference a

Git repository corrupt (incorrect header check; loose object is corrupt)

喜夏-厌秋 提交于 2019-11-27 18:55:43
I experienced a power failure yesterday evening while writing a commit message. When I booted the machine back up I couldn't complete the commit. I ran git reset , added back the changed files, and tried again, and got this: % git commit error: inflate: data stream error (incorrect header check) error: unable to unpack a94406345ac44982b00cf57b4b9660a35436637f header fatal: a94406345ac44982b00cf57b4b9660a35436637f is not a valid object git fsck reveals the following: % git fsck --full Checking object directories: 100% (256/256), done. error: inflate: data stream error (incorrect header check)

FTP zip upload is corrupted sometimes

柔情痞子 提交于 2019-11-27 15:42:56
I wrote a code for saving few images in a file and later compressing that file and uploading to an ftp server. When I download that from server, few files are fine and few files got corrupted. What can be the reason for that? Whether there may be a fault with Compress code or uploader code. Compress Code: public class Compress { private static final int BUFFER = 2048; private ArrayList<String> _files; private String _zipFile; public Compress(ArrayList<String> files, String zipFile) { Log.d("Compress", "Compressing started"); _files = files; _zipFile = zipFile; } public void zip() { try {