integrity

Django-Postgres Integrity Error: Duplicate key — how to fix?

不羁的心 提交于 2020-01-04 10:59:12
问题 Im getting an Integrity Error when adding a new instance of a model, here's the traceback: Traceback: File "/home/robain/webapps/django/lib/python2.6/django/core/handlers/base.py" in get_response 100. response = callback(request, *callback_args, **callback_kwargs) File "/home/robain/webapps/django/lib/python2.6/django/contrib/admin/views/decorators.py" in _checklogin 33. return view_func(request, *args, **kwargs) File "/home/robain/webapps/django/tmanage/tempManage/src/CTmanage.py" in addCT

Protobuf-net root serialization integrity

↘锁芯ラ 提交于 2020-01-02 07:01:14
问题 I have two objects which reference each other. [JsonObject(IsReference = true)] [DataContract(IsReference = true, Namespace = "http://schemas.datacontract.org/2004/07/TrackableEntities.Models")] [ProtoContract] public class ProtoBufObject : ITrackable { [DataMember(Order = 3)] public Guid Oid { get; set; } [DataMember(Order = 4)] [ProtoMember(4, AsReference = true)] public ChildProtoBufObject child { get; set; } [DataMember(Order = 1)] public TrackingState TrackingState { get; set; }

Green Hills Integrity Dynamic memory allocation

蓝咒 提交于 2019-12-25 03:19:10
问题 I have a requirement which need to repeatedly allocate and deallocate memory. Currently trying it on Integrity ARM simulator. I have created two tasks : First task(encoder): receives video data from a socket and encodes it and send it to second task. Second task(decoder): receives data from encoder and decodes it. In this decoding process it dynamically allocates memory and after decoding deallocates memory. After some time decoder task is suspended and cannot read protected memory error

Integrity and Authenticity

一曲冷凌霜 提交于 2019-12-24 07:47:43
问题 Sorry to keep asking so many questions, but you guys always seem to be so nice and helpful... I need to do some application that imports data from a file. For instance, user selects one file and the application imports some data to database. But I've been thinking, and this kind of app leads to a problem of integrity and authenticity of files. If a user changes the file the application is not allowed to use that information. And if one file is not from a source well known, the application can

Android: Verifying the application's integrity on the server side

青春壹個敷衍的年華 提交于 2019-12-24 02:43:08
问题 I'm writing an Android app that communicates via HTTPS with a server application. On the server side, I have to be absolutely sure about the Android app's integrity. This means that the server app needs to be sure that it's communicating with the Android app that I developed and not with a re-written one (e.g. after decompiling the original app or after having rooted the device). Is there a possibility to ensure that? Maybe there is a possibility with the signature of the apk file? Any hint

Windows 8 named pipe creation

别来无恙 提交于 2019-12-22 06:57:45
问题 How I can create named pipe in the Windows 8 with AppContainer integrity level? 回答1: As Pavel Minaev mentioned in one of comments to some answer, there are no named pipes in WinRT (for Metro applications, for desktop applications pipes are the same as in Windows 7): Named pipes aren't there, for example, nor are memory mapped files. There are sockets (including server sockets), but when connecting to localhost, you can only connect to the same app. You may be interested in the WinRT API,

To check if two image files are same..Checksum or Hash?

你离开我真会死。 提交于 2019-12-21 10:41:06
问题 I am doing some image processing code where in I download some images(as BufferedImage) from URLs and pass it on to a image processor. I want to avoid passing of the same image more than once to the image processor(as the image processing operation is of high cost). The URL end points of the images(if they are same images) may vary and hence I can prevent this by the URL. So I was planning to do a checksum or hash to identify if the code is encountering the same image again. For md5 I tried

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.

Java + MySQL integrity violation handling

和自甴很熟 提交于 2019-12-19 03:52:04
问题 I write Java program using JDBC (mysql database). When I violate mysql integrity (f.e. I try to insert same primary key value) I catch SQL exception. Should I write it in way it may never happen (f.e. at first boolean function checking whether primary key value isn't already in DB and then calling insert), or is it okay to handle it just by exception? Example : catch (SQLException ex) {ex.printStackTrace(); showSomeErrorDialog(); } 回答1: There are indeed basically two ways to achieve this:

Enable integrity checking with sqlite in django

会有一股神秘感。 提交于 2019-12-18 04:08:58
问题 In my django project, I use mysql db for production, and sqlite for tests. Problem is, some of my code rely on model integrity checking. It works well with mysql, but integrity errors are not thrown when the same code is executed in tests. I know that foreign keys checking must be activated in sqlite : PRAGMA foreign_keys = 1; However, I don't know where is the best way to do this activation (same question here). Moreover, the following code won't work : def test_method(self): from django.db