Skip to main content
Filter by
Sorted by
Tagged with
3478 votes
25 answers
1.2m views

Eclipse issues warnings when a serialVersionUID is missing. The serializable class Foo does not declare a static final serialVersionUID field of type long What is serialVersionUID and why is it ...
ashokgelal's user avatar
  • 81.7k
1771 votes
58 answers
1.1m views

How do I convert all elements of my form to a JavaScript object? I'd like to have some way of automatically building a JavaScript object from my form, without having to loop over each element. I do ...
1288 votes
15 answers
2.3m views

I have classes like these: class MyDate { int year, month, day; } class Lad { string firstName; string lastName; MyDate dateOfBirth; } And I would like to turn a Lad object into a ...
Hui's user avatar
  • 14.6k
1236 votes
11 answers
933k views

I need to serialize an object to JSON. I'm using jQuery. Is there a "standard" way to do this? My specific situation: I have an array defined as shown below: var countries = new Array(); countries[0]...
Herb Caudill's user avatar
  • 50.1k
736 votes
13 answers
178k views

I know that in terms of several distributed techniques (such as RPC), the term "Marshaling" is used but don't understand how it differs from Serialization. Aren't they both transforming ...
Peter's user avatar
  • 49.2k
672 votes
21 answers
241k views

I need to store a multi-dimensional associative array of data in a flat file for caching purposes. I might occasionally come across the need to convert it to JSON for use in my web app but the vast ...
KyleFarris's user avatar
  • 17.6k
541 votes
16 answers
844k views

How do I Deserialize this XML document: <?xml version="1.0" encoding="utf-8"?> <Cars> <Car> <StockNumber>1020</StockNumber> <Make>Nissan</Make> ...
Alex's user avatar
  • 40.6k
499 votes
30 answers
786k views

Is there a commonly accepted technique for efficiently converting JavaScript strings to ArrayBuffers and vice-versa? Specifically, I'd like to be able to write the contents of an ArrayBuffer to ...
kpozin's user avatar
  • 27.2k
461 votes
17 answers
401k views

I'm trying to learn Gson and I'm struggling with field exclusion. Here are my classes public class Student { private Long id; private String firstName = "...
Liviu T.'s user avatar
  • 23.7k
426 votes
16 answers
334k views

What is meant by "object serialization"? Can you please explain it with some examples?
Warrior's user avatar
  • 39.4k
401 votes
11 answers
466k views

How do I save a trained model in PyTorch? I have read that: torch.save()/torch.load() is for saving/loading a serializable object. model.state_dict()/model.load_state_dict() is for saving/loading ...
Wasi Ahmad's user avatar
  • 38.1k
379 votes
36 answers
681k views

I am trying to consume an API using Retrofit and Jackson to deserialize. I am getting the onFailure error No Creators, like default construct, exist): cannot deserialize from Object value (no delegate-...
José Nobre's user avatar
  • 5,117
373 votes
19 answers
290k views

Using C# .NET 2.0, I have a composite data class that does have the [Serializable] attribute on it. I am creating an XMLSerializer class and passing that into the constructor: XmlSerializer ...
leora's user avatar
  • 198k
367 votes
11 answers
528k views

I have the following method to save an Object to a file: // Save an object out to the disk public static void SerializeObject<T>(this T toSerialize, String filename) { XmlSerializer ...
Vaccano's user avatar
  • 83.2k
330 votes
9 answers
496k views

Are there simple ways to store a dictionary (or multiple dictionaries) in, for example, a JSON or pickle file? For example, if I have some data like: data = {} data ['key1'] = "keyinfo" data ...
mike's user avatar
  • 24k
327 votes
13 answers
281k views

How do generate this value in IntelliJ IDEA? I go to Settings -> Errors -> Serialization issues -> Serializable class without ‘serialVersionUID’, but it still doesn't show me the warning. My class ...
user avatar
322 votes
9 answers
184k views

I would like to provide two different serializers and yet be able to benefit from all the facilities of ModelViewSet: When viewing a list of objects, I would like each object to have an url which ...
BlackBear's user avatar
  • 23.1k
303 votes
21 answers
399k views

I'm using Python 2 to parse JSON from ASCII encoded text files. When loading these files with either json or simplejson, all my string values are cast to Unicode objects instead of string objects. The ...
Brutus's user avatar
  • 7,207
295 votes
12 answers
132k views

What is the difference between Serializable and Externalizable in Java?
user avatar
289 votes
9 answers
594k views

I want to serialize objects to strings, and back. We use protobuf-net to turn an object into a Stream and back, successfully. However, Stream to string and back... not so successful. After going ...
flipuhdelphia's user avatar
262 votes
16 answers
405k views

I have create the next Dictionary: var postJSON = [ids[0]:answersArray[0], ids[1]:answersArray[1], ids[2]:answersArray[2]] as Dictionary and I get: [2: B, 1: A, 3: C] So, how can I convert it to ...
Orkhan Alizade's user avatar
254 votes
4 answers
298k views

When I used Eclipse it had a nice feature to generate serial version UID. But what to do in IntelliJ? How to choose or generate identical serial version UID in IntelliJ? And what to do when you ...
catch32's user avatar
  • 18.8k
244 votes
13 answers
241k views

so I am getting this in logcat: java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = com.resources.student_list.Student) I know this means that my ...
user2896762's user avatar
  • 2,507
236 votes
10 answers
98k views

When class implements Serializable in Eclipse, I have two options: add default serialVersionUID(1L) or generated serialVersionUID(3567653491060394677L). I think that first one is cooler, but many ...
IAdapter's user avatar
  • 65.6k
233 votes
13 answers
149k views

I'll admit that I'm a bit of a ruby newbie (writing rake scripts, now). In most languages, copy constructors are easy to find. Half an hour of searching didn't find it in ruby. I want to create a copy ...
Precipitous's user avatar
  • 5,343

1
2 3 4 5
671