serialization

Storing a hash in memory

Hi, I have 1 GB file of tables with data separated by columns. I have parsed it and stored in hash. Later on I am using this hash for my further work. But during developing my code each time I compile for testing the " parsing and storing into hash" is executed and which makes my program slow. Is there any way where I can store it so ...

what is Deserialize & Serialize in JSON,

Hi, I'm new in JSON, but now I need to use JSON for my Flash ActionScript 3.0. So I found one lib for JSON and I have seen the terms Deserialize & Serialize what does that means. ...

Cannot get my html input array to serialize into a List<string> in Asp.Net mvc

I am attempting to implement a tagging system into my asp.net MVC project. When a user edits or adds a task, they can add any amount of tags they want before submitting. I am using the Jquery Tagit plugin, so when a user adds a new tag an input field is created that looks like: <input type="hidden" style="display:none;" value="tag1" n...

Serialize Deserialize to/from xlsx

Given the following assemblage of classes (contrived): public class School { [PrimaryKey] public string Name {get; set;} [Set] public IList<Teacher> Teachers {get; set;} public class Teacher { [PrimaryKey] public string Name {get; set;} I'd like to have the object hierarchy serialized into a single sheet of an xlsx file, ...

How to serialize the GMP mpf type?

It seems that GMP provides only string serialization of the mpf (floating point) type: mpf_get_str(), mpf_class::get_str() The mpz (integer) type has an additional interface for raw bytes: mpz_out_raw() http://gmplib.org/manual/Function-Index.html Am I missing something? Does anyone know of another library that can serialize GMP flo...

Any clever ways to serialize an HTML element? - Javascript

Hi folks, I'm trying to store a reference of an HTML tag for later reuse. e.g. If I click on a div and save a pointer to that div within Javascript, will there be a way I could serialize such pointer? So I could de-serialize it and use the pointer in another instance of the web application? Only methods I can think of are the follow...

Serialize a .net Object directly to a NetworkStream using Json.net

Hello Is there any way to have Json.net serialize an object directly to a NetworkStream? In other words, have Json.net send the serialized result to the network as it serializes the object (in a streaming fashion). I would like to avoid having to serialize the object to memory and then send it via the NetworkStream. Any thoughts? Re...

How do I implement object-persistence not involving loading to memory?

I have a Graph object (this is in Perl) for which I compute its transitive closure (i.e. for solving the all-pairs shortest paths problem). From this object, I am interested in computing: Shortest path from any vertices u -> v. Distance matrix for all vertices. General reachability questions. General graph features (density, etc). T...

Qt - Problems while serializing "double"

I serialize "double" data type and get an error though QDataStream & operator<< ( double f ) operator is defined. Here is the error message: error: conversion from 'double' to 'const QChar' is ambiguous Did you meat this situation or understand why it can be like this? ...

Is there any way to serialize / unserialize an Objective-C block?

I'm writing an app where support for "promotions" is required, and these promotions could be arbitrarily complex and many different pieces of data might be relevant in their calculation. Therefore, whilst in the early stages of development, I don't want to invent a whole specification schema for these things, I'd rather just write each ...

Data.Vector.Binary overlaps Binary [a] instance

In my application I need to serialize a vector containing an arbitrary datatype, in this case is a list of Doubles. For serializing the vector I'm importing Data.Vector.Binary. When loading the module in GHCi the following error arises: Overlapping instances for Binary [Double] arising from a use of `decode' at Statistics.hs:57:33-42...

Can I control what subtype to use when deserializing a JSON string?

I'm working with Facebook API and it's search method returns a JSON response like this: { "data": [ { "id": "1", "message": "Heck of a babysitter...", "name": "Baby eating a watermelon", "type": "video" }, { "id": "2", "message": "Great Produce Deals", "...

Error when deserialize with XmlSerializer

I'm getting an exception with this code; InnerException: System.InvalidOperationException Message=The specified type was not recognized: name='Person', namespace='', at "<"Contact xmlns=''>. Here is the relevant code I think. The class Person is a bare class without any anotations and doesn't inherit from any interface. How to m...

problem in storing asp.net table to session variable in asp.net

How can i store asp.net table to session variable using sqlserver mode? Actually i'm inserting the textboxes created dynamically on button click into asp.net table but on post back it gets vanished so decided to store in a session. If anybody is having any alternative please tell me? ...

web service return type exception

Hi there, I have a web service and its methods return a class which is name WSResult. WSResult has 2 properties. One of property's type is int and the other one's type is object. I want to return some different type with this second property. you can see my WSREult [Serializable] public class WSResult { public int M_Status { get;...

WCF: Is serialization of a generic interfaces possible?

I'm trying to implement a service contract that contains a method which takes a generic interface, and that generic interface itself is given an interface parameter. I've decorated the service interface with ServiceKnownType, I have decorated the service implementation with regular KnownType, and I have decorated the datacontract impleme...

ActiveRecord serialization problem

I have a db column which is a serialized Hash: class Foo < ActiveRecord::Base serialize :bar end When I store a hash inside of bar that is a few levels deep, the deeper levels do not seem to properly deserialize when I need them. Objects one level deep get deserialzed just fine. However, objects 2 or more levels deep remain YAML cl...

Serializing an object containing a Bitmap i .NET Compact Framework

I am writing a project for Windows mobile 6 (.NET CF 3.5). My project contains a class that looks like this: class MyClass { private Bitmap picture; //... and some other fields ... public MyClass () { picture = new Bitmap (/*Picture file path*/); //... } } To my surprise, I found out that there is ...

How to solve circular reference in json serializer caused by hibernate bidirectional mapping?

I am writing a serializer to serialize POJO to JSON but stuck in circular reference problem. In hibernate bidirectional one-to-many relation, parent references child and child references back to parent and here my serializer dies. (see example code below) How to break this cycle? Can we get owner tree of an object to see whether object ...

Parsing an XML file -options?

I'm developing a system to pick up XML attachments from emails, via Exchange Web Services, and enter them into a DB, via a custom DAL object that I've created. I've manage to extract the XML attachment and have it ready as a stream... they question is how to parse this stream and populate a DAL object. I can create an XMLTextReader and...