serialize

Is it possible to serialize wpf telerik controls

Hi, I have hashtable that contain wpf and telerik controls, and I need to serialize it to xml file. I found this code for wpf controls: string savedButton = XamlWriter.Save(origianlButton); File.WriteAllText(@"C:\test.xml", savedButton); but it doesn't work for telerik controls, it stuck and I get this error: An unhandled exception ...

Rails: Serialize value as comma-seperated and not as YAML

Hi there, I'm looking for a way to store a serialized value of eg. IDs in a column. In before claims that this is not an optimal design: the column is used for IDs of associated records, but will only be used when displaying the record - so no queries are made with selection on the column and no joins will be made on this column either....

How to serialize browser HTML DOM to XML?

I need to serialize browser parsed HTML DOM to well-format XML. In firefox (gecko), this works: // serialize body to well-format XML. var xml = new XMLSerializer().serializeToString(document.body); But in webkit, result is equivalent to document.body.outerHTML, not well-format XML (for example: <br> won't become <br />) How to seria...

Changing a property in ViewModel making Model unserializable???

Alright I'm a bit baffled by this one. Changing an unrelated int property on my ViewModel seems to be making my Model unserializable. I have an object which tracks the best time to contact someone. It can be set to Anyday, Weekdays, Evenings, SpecificDays and to Anytime, Mornings, Afternoons, Evenings, and SpecificTimes. When the object...

Serialize all id's in a div using jquery

Hi, I am trying to create a re-ordering of the page drag and drop feature on my CMS. As some of the pages have sub pages, we have a lot of lists nested within lists. An example of the code: $(document).ready(function(){ $(function() { $('#contentLeft ul').sortable({ update: function() { va...

Inserting into a serialized array in PHP

This is my first time here and I have been pulling my hair out over this one, so I thought it would be a good first question for me. I am saving some array data to a mysql database, and then later I am using unserialize to edit it. The problem is that it blanks out every other index in the array when I edit just one index. Here is som...

Custom object serialization in ASP?

I've got a handful of public static WebMethods that I'm accessing with Javascript (directly), usually through jQuery. That's working, and I'm happy with the results (and with not having to deal with the AJAX framework). What I'd like to be able to do is to define my own mock-JSON object to pass between JS and ASP (this is a .NET 2.0 we...

How do you serialize a struct and store it in a MySQL database?

I am using C++ for an online game server project and I need to store some structs as binary blobs in a MySQL database. I am using RakNet for networking and have tried using its BitStream class to serialize the data but I don't know how to do it right. My question is, how do you turn a structure into a stream of bytes that you can pass in...

Serialize complex form to JSON object using jQuery.

I've been searching for hours for this and haven't found an answer. Please read through the whole question before flaming! :) I have a form similar to this: <form id="sample"> <input name="name" type="text" value="name value" /> <input name="phone[0][type]" type="text" value="cell" /> <input name="phone[0][number]" type="text" valu...

jquery datepicker not sending data on using .serialize() for populating the grid

I have a form with 2 input type="text" , 1 combo box and other contains ( combo box contains equal , after,before & between operators + start date(jquery datepicker)+end date(jquery date picker ) but when i am sending the data to server its not appending date parameters with the url using .serialize(). My approach: $("form#transactionF...

WCF REST and JSON - Serialization and empty elements

Hey, I am returning a list of items (user defined class) in a REST service using WCF. I am returning the items as JSON and it is used in some client side javascript (so the 'schema' of the class was derived from what the javascript library required). The class is fairly basic, strings and a bool. The bool is optional, so if it is absent...

Don't know how use 'serialize' method in rails

i have a model called user class User < ActiveRecord::Base serialize :friends end when running the console script and create a new object of User class user = User.new user.friends i found a 'NoMethodError' should i write the serialize calling in another file? OR what should i do to make the friends array an attribute for the ...

How to serialize object into UTF-8

Hi, I'm trying to insert into XML column (SQL SERVER 2008 R2), but the server's complaining: System.Data.SqlClient.SqlException (0x80131904): XML parsing: line 1, character 39, unable to switch the encoding I found out that the XML column has to be UTF-16 in order for the insert to succeed. The code I'm using is: XmlSerializer se...

rails to_json unexpected behavior for include_root_in_json

Hi - I have a model like this class Parent < ActiveRecord::Base :has_many :kids end class Kid < ActiveRecord::Base :has_many :grandkids :belongs_to :parent end I can generate json like this: the_parent.to_json( :methods => [:kids] ) => { "parent" : { "kids" : [ { "kid" : { "name" => "kid0" .... and so on. Just what I want. ...

jquery .live on form submit not picking up dynamically added inputs

when my ajaxupload script finishes it adds a read-only input w/ the value of the image's URL. it is a long script, but i think this is the relevant part that fires on successful completion: var location = '<div id="'+ID+'_location" class="img_location">' + '<input name="'+ID+'" class="location regular-text" type="text" size="50" read...

what is the difference between Serializing and encoding?

what is the difference between Serializing and encoding? and when should i use each in a web service? ...

How can I replace a standard textarea with "insertable" text fields?

Hi all, I'd like to be able to replace a standard HTML <TEXTAREA> input with insertable <INPUT> text inputs. By insertable, I mean having two TEXT form inputs (name, role) and an "Add" button after it to add a new name/role after this one if desired. Ideally I'd have 'role' in an HTML <SELECT> input (drawn from my database) but I'm not...

Django-Python: Generate XML file from model data

I need to write model data (CharFields only) to an XML file to contain the data for a flash file. I am new to this, and the process is a little unclear to me for doing this in django. I am creating an xml file, and then writing the text data to the file (as is done with the csv module, but to xml). A very simplified xml file should re...

doctrine2 dql query by property of serialized object within entity

I have an entity with an 'object' type column. I want to be able to retreive the entity by a property (say id) of that object. For example, the query would look something like this: $em->createQuery('SELECT e FROM Entity_Class e SOME_MAGIC e.object o WHERE o.id = ?1'); The question is, is there *SOME_MAGIC* in dql? ...

Postgresql Serialize

Is it possible to search a field that was serialized in php and stored like that in postgresql ? ...