serialization

WCF Service Reference - Getting “XmlException: Name cannot begin with the '<' character, hexadecimal value 0x3C” on Client Side

本秂侑毒 提交于 2020-02-17 11:24:28
问题 I have a smart client application communicating with its server via WCF. Data is created on the client and then sent over the service to be persisted. The server and client use the same domain classes via a shared dll and I'm using the handy "Add Service Reference" functionality in Visual Studio that wraps SvcUtil.exe and generates the client and proxy classes. I get the following error when trying to call the service: System.Xml.XmlException occurred Message=Name cannot begin with the '<'

How do I get a string value of the 5 digit serial date format from a cell into my script?

我怕爱的太早我们不能终老 提交于 2020-02-16 10:31:27
问题 I have a formula in a cell that is doing a vlookup to another sheet by combining the values of two cells on my spreadsheet. It's a table of names on the left and dates up top. I'm combining the name and date values into a single string value and using that as by vlookup key value, which works great. Now I need to basically do the same thing in my google script, but the date value has me at a loss. In the vlookup cell formula, the date value is the 5 digit date serial code. However when I

How do I get a string value of the 5 digit serial date format from a cell into my script?

送分小仙女□ 提交于 2020-02-16 10:30:14
问题 I have a formula in a cell that is doing a vlookup to another sheet by combining the values of two cells on my spreadsheet. It's a table of names on the left and dates up top. I'm combining the name and date values into a single string value and using that as by vlookup key value, which works great. Now I need to basically do the same thing in my google script, but the date value has me at a loss. In the vlookup cell formula, the date value is the 5 digit date serial code. However when I

XML serialization of a Dictionary with a custom IEqualityComparer

天涯浪子 提交于 2020-02-15 09:15:59
问题 I want to serialize a Dictionary that has a custom IEqualityComparer . I've tried using DataContractSerializer but I can't get the Comparer to be serialized. I can't use BinaryFormatter because of this. I can always do something like: var myDictionary = new MyDictionary(deserializedDictionary, myComparer); But that means I'd need twice the memory the dictionary uses. 回答1: Why does the custom Comparer even need to be serialized? Here is a test case that works for me. using System; using System

Socket readLine() doesn't receive line sent

好久不见. 提交于 2020-02-15 06:34:05
问题 I'm building a client-server project. What I need is that the client sends a string, such as "Pendu", and the server receives this string and send an object named "Pendu" back to the client. Here is my code: // server ServerSocket serverSocket = new ServerSocket(6789); System.out.println("accepting..."); Socket socket = serverSocket.accept(); BufferedReader inFromClient = new BufferedReader(new InputStreamReader(socket.getInputStream())); ObjectOutputStream outToClient = new

Socket readLine() doesn't receive line sent

南笙酒味 提交于 2020-02-15 06:33:11
问题 I'm building a client-server project. What I need is that the client sends a string, such as "Pendu", and the server receives this string and send an object named "Pendu" back to the client. Here is my code: // server ServerSocket serverSocket = new ServerSocket(6789); System.out.println("accepting..."); Socket socket = serverSocket.accept(); BufferedReader inFromClient = new BufferedReader(new InputStreamReader(socket.getInputStream())); ObjectOutputStream outToClient = new

Socket readLine() doesn't receive line sent

两盒软妹~` 提交于 2020-02-15 06:32:57
问题 I'm building a client-server project. What I need is that the client sends a string, such as "Pendu", and the server receives this string and send an object named "Pendu" back to the client. Here is my code: // server ServerSocket serverSocket = new ServerSocket(6789); System.out.println("accepting..."); Socket socket = serverSocket.accept(); BufferedReader inFromClient = new BufferedReader(new InputStreamReader(socket.getInputStream())); ObjectOutputStream outToClient = new

Opposite to serializeArray in jQuery (restore form)

旧城冷巷雨未停 提交于 2020-02-13 08:38:11
问题 Having the data from serializeArray , how do you update the form with it? var values = form.serializeArray(); form.deserializeArray(value); // What is the deserializeArray analogue? form.seriaizeArray() === values; // So that this is always true 回答1: See jQuery plugin to serialize a form and also restore/populate the form 回答2: We can iterate over the array and restore the form. for (var i = 0; i < values.length; i++) { $("input[name='" + values[i].name + "'], select[name='" + values[i].name +

Jackson custom JsonSerializer - conditionally call default serializer

倾然丶 夕夏残阳落幕 提交于 2020-02-12 04:23:10
问题 What I want is to use default BeanSerializer conditionally for my class's objects: class MyCustomSerializer extends StdSerializer<AbstractEntity> { public MyCustomSerializer() { super(AbstractEntity.class); } @Override public void serialize(AbstractEntity o, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { if (someCondition()) { serializeNormalWay(); //how? } else { //custom serialization } } } I've tried to do something like that: serializerProvider

Error - is not marked as serializable

别来无恙 提交于 2020-02-09 08:59:28
问题 The error I'm getting is: Type 'OrgPermission' in Assembly 'App_Code.ptjvczom, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable. here is my code: I have a gridview, that uses the following DataSource: <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetOrgList" TypeName="Org"> <SelectParameters> <asp:SessionParameter Name="orgCodes" SessionField="UserOrgs" Type="Object" /> <asp:Parameter DefaultValue="Y" Name="active" Type="String"