serialize

.NET Serialize XmlNode problem

So I am trying to simply decorate a class to serialize it as XML. Here's an example of my problem. [XmlElement("Dest")] public XmlNode NewValue { get; set; } The real problem here is that sometimes in this implementation the XmlNode can be an XmlElement or XmlAttribute. when it's an element this code works fine, but when it comes ...

How to use JQuery ajaxForm with nicEdit?

I am using ajaxForm function to submit my form that has nicEdit html editor as well but when I tried to submit the form for the first time the content of the nicEdit is not included... Is there a way that I can intercept the data submitted so I can edit the form data? or maybe add values to the form-data before it actually gets submitted...

In what circumstances should you serialize data? When should you not?

I'm aware that serializing is used to convert data types into a storable format, for purposes such as caching. What I'm more specifically asking is, what are the circumstances in which you should actually decide to store data ( using serialize() in PHP, pickle module in Python, et cetera )? Let's say we had a high traffic websi...

C#: How should I save my data?

I have two structs like so: public struct KeyLog { Keys key; DateTime time; } public struct MouseLog { MouseEvents mouse; Point coordinates; DateTime time; } For every keyboard key press and mousebutton click I wish to save this data but I do not know which way would be the most efficient to store/handle it in? Ar...

ActiveRecord serialize using JSON instead of YAML

I have a model that uses a serialized column: class Form < ActiveRecord::Base serialize :options, Hash end Is there a way to make this serialization use JSON instead of YAML? ...

serialization of function/api calls (at a target) over some transport

I have set of api's to be called over a transport (say for eg RS232 and some other transports). Essentially the calling side runs on a host and sends something like this: (func_name, param_1, param_2, param_3) over the RS232 link and a bit of code at the other end does the actual function calling. To transfer the function name and par...

Serializing data using IEnumerable<T> with WebGet

possible duplicate: Cannot serialize parameter of type ‘System.Linq.Enumerable… ’ when using WCF, LINQ, JSON Hi, If my method signiature looks like this, it works fine. [WebGet] MyClass[] WebMethod() If the signiature looks like this [WebGet] IEnumerable<T> WebMethod() I get the following error: Cannot serialize parameter...

Serialize ComponentModel.Container???

Is it possible to serialize (binary) a System.ComponentModel.Container? ...

sortable lists, with sortable lists...

hello there - i'm trying to have 3 levels of lists all of which are sortable & draggable into each other. Basically trying to set up an easy way to manage navigation menus with multiple levels. Its 90% there but for some reason it wont save an item into a child list. It just seems to get the parent id of the list it came from?! ie. a ...

Upgrade from jQuery 1.3.2 to 1.4 sortable serialize stops working

i just upgraded from jquery 1.3.2 to 1.4 - and I found my sortables serialize not working anymore?! anyone else experience this problem? heres the code: $(document).ready(function() { $("#list_to_sort").sortable({ handle : '.handle', update : function () { var order = $('#list_to_sort').sortable('serialize'); $("upd...

Represent XML without xsd

Note: I cannot use XSD... not going to go into why. I'm having a problem properly representing the following xml in a class that it should get deserialized into: XML: <product> <sku>oursku</sku> <attribute name="attrib1">value1</attribute> <attribute name="attrib2">value2</attribute> <attribute name="attribx">valuex</attri...

jQuery AJAX timing issue

In my backend I'm using jquery 1.4.1 and the newest UI 1.8rc1. I defined a couple of buttons that do things... one is create a certain type of page using serialize functions calling a php file and then reloading the entire page. locally this always works like a charm! but as soon as i put it on my providers webserver, it only works in ab...

How can I customize serialization of a list of JAXB objects to JSON?

I'm using Jersey to create a REST web service for a server component. The JAXB-annotated object I want to serialize in a list looks like this: @XmlRootElement(name = "distribution") @XmlType(name = "tDistribution", propOrder = { "id", "name" }) public class XMLDistribution { private String id; private String name; // no...

EF -> WCF -> JSON

I have a Windows Communication Foundation service which queries the Entity Framework and retrieves data in the form of Entity objects. I'd like to serialize these objects to JSON and send them back to the client to be interpreted in Javascript. It seems this is tricky, according posts like these: http://bloggingabout.net/blogs/progr......

Making Child classes as Non Serializable in java

I have a class which implements Serializable. Now I extends this class and I want this extended class to be non Serializable. So how to do it? For example. I have class A implements Serializable. and i have class B extends A. But I want class B to be Non Serializable. ...

jquery buggy sort serialize

Hi, i have discovered quite an odd behaviour of jquery. I have two lists here, where i drag and drop li-elements from one to another, the current sortings is being saved by ajax-mysql. Now this afternoon i noticed that sometimes, just sometimes the position of the last dropped item wasnt saved properly, it was saved as "0" when it should...

How to serialize a DataTable to a string?

Recently I was in the need to serialize a DataTable as a string for further processing (storing in a file). So I asked myself: How to serialize a DataTable into a string? ...

R: serialize objects to text file and back again

I have a process in R that creates a bunch of objects, serializes them, and puts them into plain text files. This seemed like a really good way to handle things since I am working with Hadoop and all output needs to stream through stdin and stdout. The problem I am left with is how to read these objects out of the text file and back in...

Writing XML on Android

Given an instance of org.w3c.dom.Document, how do I save its contents to a file/stream? EDIT: As CommonsWare pointed out, there's no such possibility using classes from Android SDK. Can you recommend then a third-party library for saving Document contents to a file/stream? ...

Is there a fast and reliable way of serializing objects across different versions of Ruby?

I have two applications talking to each other using a queue, as of now they run exactly the same version of ruby (1.8.7), so I'm just marshaling objects back and forth; only objects from the standard lib mostly hashes, strings, time and date objects. Right now I'm moving to Ruby 1.9.1, one app at the time, which means I'll be running o...