serialization

Strongly Typed DataSet column requires custom type to implement IXmlSerializable?

I have a strongly typed Dataset with a single table with three columns. These columns all contain custom types. DataColumn1 is of type Parent DataColumn2 is of type Child1 DataColumn3 is of type Child2 Here is what these classes look like: [Serializable] [XmlInclude(typeof(Child1)), XmlInclude(typeof(Child2))] public abstract c...

how do "saved states" work? (Android)

I just read a pretty interesting article on how android (and i assume other OSs) work when low on memory. How is this done theoretically? Is it similar to Java's object serialization? ...

How do I serialise a graph in Java without getting StackOverflowException?

I have a graph structure in java, ("graph" as in "edges and nodes") and I'm attempting to serialise it. However, I get "StackOverflowException", despite significantly increasing the JVM stack size. I did some googling, and apparently this is a well known limitation of java serialisation: that it doesn't work for deeply nested object g...

changing the serialization procedure for a graph of objects (.net framework)

Hello I'm developing a scientific application using .net framework. The application depends heavily upon a large data structure (a tree like structure) that has been serialized using a standard binaryformatter object. The graph structure looks like this: <Serializable()> Public Class BigObject Inherits List(Of SmallObject) End Class <...

Deserializing Metafile

I have an application that works with Enhanced Metafiles. I am able to create them, save them to disk as .emf and load them again no problem. I do this by using the gdi32.dll methods and the DLLImport attribute. However, to enable Version Tolerant Serialization I want to save the metafile in an object along with other data. This esse...

Why do you have to mark a class with the attribute [serializable] ?

Seeing as you can convert any document to a byte array and save it to disk, and then rebuild the file to its original form (as long as you have meta data for its filename etc.). Why do you have to mark a class with [Serializable] etc? Is that just the same idea, "meta data" type information so when you cast the object to its class thin...

Persist an object that is not marked as serializable

Hi, I need to persist an object that is not marked with the serializable attribute. The object is from a 3rd party library which I cannot change. I need to store it in a persist place, like for example the file system, so the optimal solution would be to serialize the object to a file, but since it isn't marked as serializable, that is...

How to unit test that a Windows Workflow Foundation (WF) activity can be serialized?

Problem: during execution, instances of classes that derives from System.Workflow.ComponentModel.Activity is serialized by the workflow engine. I'd like to unit test these types in order to ensure that they can be serialized. As of now, these exceptions only show up in production. Non-working solution: public class UnitTestActivity : A...

DataContractJsonSerializer set value extension point

using System.IO; using System.Runtime.Serialization; using System.Runtime.Serialization.Json; using System.Text; namespace ConsoleApplication1 { internal class Program { private static void Main(string[] args) { var pony = new Pony(); var serializer = new DataContractJsonSerializer(pony.GetType()); var example = ...

How can serialisation/deserialisation improve performance?

Hi, I heard an example at work of using serialization to serialise some values for a webpart (which come from class properties), as this improves performance (than I assume getting values/etting values from/to database). I know it is not possible to get an explanation of how performance in the scenario I speak of at work can be improved...

Benefits of Doctrine array column vs custom serialization?

I have an application that I'm converting to Symfony/Doctrine. It currently stores a serialized array as a JSON object in the database. I see that Doctrine has an array column that does similar serialization. Is there any performance benefit to the array column verses having custom json_decode/encode getters and setters? What serializati...

Flex: Configure AMF serialization warnings?

I have been trying to test my application to make sure that all the important classes can serialize/reload themselves properly (especially those which implement IExternalizable): [Test] public function testMyObjectSerialization():void { var myobj:MyObject = new MyObject(); var ba:ByteArray = new ByteArray(); ba.writeObject(m...

How to debug exception, "Type is not marked as serializable", when the type is marked as serializable.

I'm trying to: ((Request.Params["crmid"] != null)) in a web page. But it keeps throwing a serialization exception: Type 'QC.Security.SL.SiteUser' in assembly 'QC.Security, Version=1.0.0.1, Culture=neutral, PublicKeyToken=null' is not marked as serializable. The type, a custom IIdentity, is however marked as serializable ...

Serializing and deserializing data - JavaScript

Hi folks, I need to perform a lot of serializing and de-serializing in an application. The data is POST parameters and Cookie headers. Post data example: Name=Jonathan+Doe&Age=23&Formula=a+%2B+b+%3D%3D+13%25%21 Set-Cookie data example: ASP.NET_SessionId=esur3bqqgrmnci45um4xegye; path=/ Does anyone have any fast librari...

Can SerialVersionUid be any number or does it have to be compiler generated?

If I write a serialversionUid for my class as say 1234, and I know that no other class in my program uses that, is that fine or do i always have to use a uid generated by the compiler? ...

XML Serialization and Soap Serialization

Hi I think even if we will not need interoperability between applications, and even we do not communicate with web services, it is easier to serialize using SoapFormatter than XmlSerializer because SOAP will serialize the private members by default, while XmlSerializer will work on public properties and fields. actually I cannot find a...

Circular reference error when outputting LINQ to SQL entities with relationships as JSON in an ASP.NET MCV 2 Web Application

Here's a design-view screenshot of my dbml-file. The relationships are auto-generated by foreign keys on the tables. When I try to serialize a query-result into JSON I get a circular reference error..: public ActionResult Index() { return Json(new DataContext().Ingredients.Select(i => i)); } But if I create my own collection ...

Jquery Serialization not working

Have a simple form (only extract fields here) but for some reason the JQserilization is not working; looks fine in alert() but only the first form field gets posts. Suggestions please - thanks in advance Form: <form id="neweventform" method="post" action=""> <div class="grid_4 alpha">Setup date *</div> <div class="grid_7 omega"> <sele...

Java invalid stream header Problem

Hi all, im writen a client-server app, and now i´m facing a problem that I dont know how to solve: This is the client: try { Socket socket = new Socket(ip, port); ObjectOutputStream ooos = new ObjectOutputStream(socket .getOutputStream()); SendMessage message = new Send...

Serialize Dictionary with a string key and List[] value to JSON

How can I serialize a python Dictionary to JSON and pass back to javascript, which contains a string key, while the value is a List (i.e. []) if request.is_ajax() and request.method == 'GET': groupSet = GroupSet.objects.get(id=int(request.GET["groupSetId"])) groups = groupSet.groups.all() group_items = [] #list groups_and_...