serialization

What's the fastest way to save data and read it next time in a IPhone App ?

I have the following problem: In my dictionary IPhone app I need to save an array of strings which actually contains about 125.000 distinct words; this transforms in aprox. 3.2Mb of data. The first time I run the app I get this data from an SQLite db. As it takes ages for this query to run, I need to save the data somehow, to read it fa...

Using a different type for a collection when serializing with WCF

Imagine I've got a data object that makes sense in an OO model, but for serialization I want to have its fields referencing other types replaced with simply an ID, or in some cases, a simple object with a text and an ID. Is it possible to have the serializer to handle specific fields differently, or do I have to redefine a second data o...

.NET Json Serialization Circular Ref Error (Object involves structuremap vars)

I have a web method called from Jquery to display a hierarchical tree object. The return value is a List (Of T) , where T is hierarchical, a parent-child relationship. traversal will be from parent to child. 1) .Net automatically converts the return value from webmethod to JSON to send it back to js client. At that point it throws a ci...

deserialize XML into classes that extends collection

I deserialize XML into classes: My XML file: <?xml version="1.0" encoding="utf-8" ?> <ToolBarConfiguration> <ToolBars> <ToolBarSet id="1" buttonsCounter="4" width="252"> <ToolBarItems> <ToolBarItem id="1" Command="Command11" Icon="pic11" Icon2="pic11" Enabled="true" Visible="true" Type="Button"/> <ToolBarIt...

XmlSerializer doesn't serialize everything in my class

I have a very basic class that is a list of sub-classes, plus some summary data. [Serializable] public class ProductCollection : List<Product> { public bool flag { get; set; } public double A { get; set; } public double B { get; set; } public double C { get; set; } } ... // method to save this class private void Save...

Serializable class inheriting from an Interface with a property of its own type

I have an interface, with a definintion for a property that is the same type as the interface. public interface IMyInterface { IMyInterface parent { get; set; } } Now if I declare a class and inherit from the interface, I need to create the property called parent. I want my class to be serializable to us...

Xml in Dot net 3.5:how to load xml document into object of class generated from schema?

I have defined schema for xml in file "packetTemplate.xsd".Using ms tool "xsd.exe" i have generated class "PacketTemplate" corresponding to schema.Does dot net provides api that can load xml document by refering to file and returns object of class PacketTemplate. ...

CompositeControl and XML Deserialization on design-time error.

I get "Error rendering control" error that only happens when I place the control on the webform in desgin-mode, if I run the page the control is displayed correctly. The above statement is not important, this error happens because the returned toolbars object is null. After debugging, the problem is in a function that is called from Ce...

Deserialize XML to custom Class in Flex?

Is it possible to deserialize an XML file to a class in Flex without manually checking the XML and/or creating the class, with the help of a HttpService? Edit: Explained a bit more and better. We have an XML file which contains: <Project> <Name>NameGoesHere</Name> <Number>15</Number> </Project> In Flex we want this to be serializ...

c# - How to deserialize a generic list<T> when I don't know the type of (T)?

Hi, for auditory reasons I stores the arguments of the business methods serialized into the database using the binaryformatter. The problem is that when an argument is a generic list I don't find the way to cast the deserialized object because I don't know the type, or If I will know the type I don't know how to cast the object at runt...

Object serializing performance

Let's say I have a simple tcp server generating an array inside a thread, serializes it and sends it to a client over tcp connection and when it reaches the client, the client deserializes it and performs something...ie. continuous calculation. Well it's a pretty straight forward process but I would like to know if the process has any pe...

How to implement serialization in C++

Whenever I find myself needing to serialize objects in a C++ program, I fall back to this kind of pattern: class Serializable { public: static Serializable *deserialize(istream &is) { int id; is >> id; switch(id) { case EXAMPLE_ID: return new ExampleClass(is); //... ...

C++ serialization library that supports partial serialization?

Are there any good existing C++ serialization libraries that support partial serialization? By partial serialization I mean that I might want to say, save the values of 3 specific members, and later be able to apply that saved copy to a different instance, only updating those 3 members and leaving the others intact. This would be useful ...

.NET/C#: Using RSS.NET with Stack Overflow Feeds: How To Handle Special Properties of RSS Items?

I'm writing a Stack Overflow API wrapper, currently at http://soapidotnet.googlecode.com/. I have a few questions about parsing SO RSS feeds. I've chosen to use RSS.NET to parse the RSS, but I have a few questions about my code (which I have provided further down in this post). My Questions: First of all, am I parsing those attribu...

Change serialization functions in PHP for Memcached

By default Memcached module in PHP uses PHP's built in serialization functions. Because I'm accesing the same keys from other programming languages, I have found a serialization module that works in all languages. How do I use my serialization module instead of PHP's when storing/retrieving keys from Memcached? ...

Make Java runtime ignore serialVersionUIDs?

I have to work with a large number of compiled Java classes which didn't specify explicitly specify a serialVersionUID. Because their UIDs were arbitrarily generated by the compiler, many of the classes which need to be serialized and deserialized end up causing exceptions, even though the actual class definitions match up. (This is all ...

Serialized data in mysql database needs to combined in an array

I am working in PHP/MySQL. I have a table in my database called hourly in that table their is a column named webaddress these are serialized. There are multiple rows of each column of webaddresses each is serialized. I need to pull each row, unserailize them then put them into an array. I tried using this bit of code but it only gr...

XML alternative of Text.JSON.Generic for Haskell

Is there any XML-(de)serializer for Haskell using Data/Typeable with functions similar to toXml :: Data d => d -> XmlValue fromXml :: Data d => String -> Result d in the spirit of Text.JSON.Generic? ...

C# WPF convert BitmapImage pasted in richtextbox to binary

Hi everyone, I've got a richtextbox, that I plan on saving to a database, which can be loaded back into the same richtextbox. I've got it working so that I can save the flowdocument as DataFormats.XamlPackage, which saves the images, but the issue is that the text isn't searchable. With DataFormats.Xaml, I've got the text of course, b...

Using SoapFormatter to Serialize Selective Properties of a Class

Hi I need to serialize several fields of my class class Foo { Guid value1; decimal value2; SomeCustomEnum value3; } Can I serialize all fields one by one: MemoryStream ms = new MemoryStream(); SoapFormatter sf = new SoapFormatter(); sf.Serialize(ms,value1; sf.Serialize(ms, value2); ...