I have a class, which holds a static dictionary of all existing instances, which are defined at compile time.
Basically it looks like this:
[DataContract]
class Foo
{
private static Dictionary<long, Foo> instances = new Dictionary<long, Foo>();
[DataMember]
private long id;
public static readonly Foo A = Create(1);
public s...
Hi
I am new to ASP.NET, AJAX, JSON, jQuery and am trying to figure out a solution to the following problem:
There is this web page in ASP.NET which would contain few radio buttons. The page_load() would query SQL Server database and get a list of years i.e. 2009, 2008, 2007, 2006 etc. In the client side script, I need to create as many...
I'm trying to deserialize the following XML output:
<?xml version="1.0" encoding="ISO-8859-1"?>
<Foo>
<Val>Data1</Val>
</Foo>
<Foo>
<Val>Data2</Val>
</Foo>
(This is output from a hardware device, and cannot be changed)
I have an XML type defined as:
[XmlType(AnonymousType=true, Namespace="")]
public class Foo
{
...
A part of my web app involves creating 'appointments' (shifts) using a drag-and-drop selector for each day. Currently, this data is serialized to something like this:
9,10,11,12,13,14,15,16,76,77,78,298,299,300,301,302,303,304,
Where each number represents the nth half-hour of the week (so 304 is the 300th half-hour of the week, or 8a...
I have a dataset named DocumentDataSet along with a class named Document.
When the dataset is serialized, I need it to have it root named "Document" because I'm communicating with a 3rd party webservice.
I though of defining the attribute XmlRoot in the partial class of the dataset, but I cannot add a duplicate of XmlRoot since it is a...
I am implementing a user control that has a method that takes an Action delegate as a parm.
Attempting to store the delegate in Control State yields a serialization error. Is it even possible to serialize a delegate into Control State?
BP
...
I use a lot of XML serialization in one app I am busy with. .Net by default just shoves everything on 1 line.
Is it not possible to get some formatting order during the serialization. Would like to have it neater, because at times people have to open these xml files up and read them.
I guess what would be awesome is to have correct i...
Is there any good approach to serialzing and de-serializing large files (>10M) in c#.
Thanks in advance.
...
Hi!
I have a question about deserialization.
It's a part of xml file
<N Name="MyName">Number of MyName</N>
and class in c#:
MyN
{
[XmlAttribute(AttrName='Name')]
public string Name {get;set;}
public string Number {get;set}
}
I want to make that value of N in xml file (in samle - "Number of MyName") will deserialze in proper...
I'm using serialization and deserialization in C# for my Project (which is a Class).
They are serialized and saved to an XML file. When loading the Project, all goes well.
Now I'm trying to encode the serialized Project to Base64 and then save the file, which goes well too. The first line of the file (before encoded!) looks like this:
...
I have a f# library with some values that I want to serialize in c# with json.
With registers I had no problems but I'm having errors when I try to serialize algebraic data types.
For example, lets say this is the f# module and I want to serialize t1.
module Module1=
type Tree = Leaf | Branch of Tree * int * Tree
let t1 = Le...
I can't seem to find a good way to serialize both Django Models and Python dictionaries together, its pretty common for me to return a json response that looks like
{
"modified":updated_object,
"success":true
... some additional data...
}
Its simple enough to use either simplejson to serialize a dict or Django's serializers.seri...
I added a custom attribute to an enum that I was using as part of a web service. When I add the web service as a service reference to a win forms application the custom attributes do not appear in the service reference proxy objects although the enum type itself does appear. I've looked all over and haven't found anything close to a solu...
I'm getting a bit frustrated by the lack of consistency within the different forms of serialization in .NET:
DataContractSerializer - uses new attributes OR old [Serializable] attributes, but the serializer itself does not implement IFormatter where some of the other WCF serializers do. Opt IN.
NetDataContractSerializer - uses new attr...
The project continues . .
I have a form that I'm serializing with the jquery form plugin. Works great.
I am then using the jquery ajax feature to post to an asp.net web method so that each form element can be inserted into a database.
My issue is this, how do I loop through each of the request.form params that is sent via ajax in t...
So I need to serialize a generic dictionary like Dictionary<long, List<MyClass>>. I need to serialize it to store it in the ViewState of an ASP.Net application.
I found an example of using TypeConverter to convert my class to a string to be serialized, but I get an error message saying MyClass is not marked as serializable.
Here is th...
Hi,
I am writing the service to implement the audit in our application wherein users can view the status of a particular entity before and after any modification and should also be able to roll it back. We have decided to store the XML Serialized object in the databse in XML_TYPE column.
I am new to serialization, I don't know how to a...
Hi everyone!
How can I implement a Serialization Proxy that can be used with a XMLEncoder/Decoder?
The classic one (the Bloch one, I mean) doesn't work...
...
<name>Hello '"world", ü ë &%;</name>
<label>''MHU233%;'</label>
XmlSerializer.Deserialize(XmlReader) throws an InvalidOperationException in first case above. Would like to know what is wrong and why latter is ok. XmlReader is created with XmlSettings in constructor where Xml-schema is in SchemaSet.
Thanks!
...
>>> idmapfile = open("idmap", mode="w")
>>> pickle.dump(idMap, idmapfile)
>>> idmapfile.close()
>>> idmapfile = open("idmap")
>>> unpickled = pickle.load(idmapfile)
>>> unpickled == idMap
False
idMap[1]
{1537: (552, 1, 1537, 17.793827056884766, 3), 1540: (4220, 1, 1540, 19.31205940246582, 3), 1544: (592, 1, 1544, ...