Serialization is the process by which an object is converted into a format that can be stored and later retrieved.
3
votes
1answer
36 views
Something to store any (standard) data in python
I decided to try make my own way to save normal python data yesterday after coming across the minecraft NBT format, it's more limited than cPickle but appears to produce shorter results and so far ...
0
votes
1answer
51 views
Create Xml to string serializer
I don't want to serialize everything. I created a custom attribute DoNotSerializeAttribute. If some property in info contain ...
1
vote
1answer
42 views
Object parser in C++
Consider the following contrived data type:
Building: int age, char* location, float ...
1
vote
0answers
92 views
Saving the state of a ViewModel
I've the following scenario, I've got some viewmodel that need to persist their state on disk.
I've defined a custom attribute as:
...
3
votes
1answer
39 views
Vigenère cipher as an IO filter
I implemented a Vigenere encoding and decoding class. Ideally, the program should be able to take any abritrary file, read into an array of byte, and decode it.
...
2
votes
1answer
75 views
A Dynamic CSV Serializer
I made a dynamic CSV serializer as a learning challenge a while back, I'm hoping to get my code picked apart so I can learn what I can do better.
This is a bit long, so I wouldn't expect anyone to ...
6
votes
1answer
80 views
Reading bytes from packet
I have a device I connect to on TCP socket. I send it a message with what I want and it sends back all sorts of useful information:
Header:
...
1
vote
0answers
313 views
Reusable REST service class for Angular2 in TypeScript
I am creating an Angular 2 web application using TypeScript. This application performs REST requests to a REST "service". For each REST resource in my service I create a separate "Service" class in ...
0
votes
1answer
45 views
Reading many kinds of numbers from a byte buffer
I've been trying to find a way to collapse all these methods into one.
Current I have these methods
...
5
votes
1answer
49 views
Polymorphic TLV serialization
Inspired by this question I decided to write an alternative that uses polymorhphism and a Factory pattern. The code works for the subset of implemented types, namely ...
6
votes
1answer
208 views
TLV implementation in C++
I tried implementing TLV(https://en.wikipedia.org/wiki/Type-length-value).
Actually my implementation is more than TLV because it supports additional "Tag" elements (which you can use for naming ...
5
votes
2answers
349 views
Type to byte array conversion in Swift
I need the byte representation of a given type, especially double, float, int8, etc.
...
7
votes
2answers
54 views
Querying Facebook for details of a user's OAuth token
This class exposes the public method getAuthToken which takes a user's Facebook OAuth token as an input parameter and queries Facebook for information about it - ...
7
votes
2answers
71 views
Updating resources while avoiding race conditions
I am writing a utility class for a game client. This class has two main functions: connect to a game server and retrieve the current game revision, and retrieve a "recipe", which is basically ...
5
votes
3answers
59 views
Advanced formatting with argument passing
I want to customise how my objects are printed using the .format() function.
I have two problems to make that happen in clear and concise way. But since the second ...
4
votes
3answers
565 views
Format of hexeditor
Is there a cleaner way to write this code? It's the start of a hexeditor I'm creating.
I'm aware that the variables aren't descriptive, this is just a test run for when I imbed it into a File ...
4
votes
1answer
38 views
Which loop to use for multiple if statements which serialize objects
I have figured out how to serialize multiple objects, however I am utterly convinced I can use some kind of loop for the if statements below, to avoid duplication. Please can someone advise how I ...
3
votes
1answer
57 views
Serializing multiple objects to a file
I am very new to Java and although my code works, I know that it must be possible to write this using fewer lines of code. I am serializing multiple objects, eventually I will look into serializing to ...
1
vote
1answer
44 views
Dynamic CSV Formatter
I made a dynamic CSV formatter as a personal challenge after having to hardcode a behavior to convert some data to CSV earlier. You input any List that contains supported types as properties (all ...
2
votes
0answers
63 views
Generic methods for serializing and deserialzing xml files using streams followup
Recently I asked this question: Generic methods for serializing and deserialzing xml files using streams
However it has come to my attention that this gives me an (harmless) exception when trying to ...
5
votes
2answers
123 views
1
vote
1answer
31 views
WebService --> XML Cache Repository
I'm working on a small application that uses a WebService to get meta-data about television episodes. What I'd like to do is start building out a local cache of the series so that I can reduce the ...
5
votes
6answers
149 views
__repr__ for a binary tree whose constructor has default arguments
I recently have been working on a BinaryTree class, and looked into creating a proper __repr__ which when eval'ed would recreate ...
1
vote
0answers
50 views
Better way to deep copy than this? How can I make it generic by `Collection` type?
Could I make this method for deep copy generic to the Collection type?
That method is so simple and I can't imagine ever needing to change it, so maybe I should ...
0
votes
0answers
48 views
Pool readers and streams with Json.NET
This code is built on Json.NET and gets called hundreds of times per second. My data starts in an ArraySegment<byte>. I wrap that in a ...
11
votes
7answers
573 views
Numbers to byte-arrays and back
As the title explains, this is a series of extension methods that convert certain numeric types to and from byte-arrays, for certain actions which work better on byte-array types than numeric types.
...
2
votes
1answer
51 views
Three ways to read a number for a BitInputStream
I'm trying to learn how to write more readable code without introducing easily avoidable performance killers.
This is part of a BitInputStream Java class I'm ...
3
votes
1answer
277 views
Little/Big Endian conversion
I wanted to make sure that my code is properly converting between the two endians.
Here is the code where I read in an integer:
...
6
votes
2answers
351 views
Converting a SecureString to a byte array
Does it allocates something that hasn't freed? Something that remains in memory? Except result byte array, ofc.
...
1
vote
1answer
126 views
Re-use of read/write object , for multiple objects
I have read a lot about serialization and I cannot figure out how I am able to serialize then deserialize multiple objects. I am very much a newb to Java, so please bear with me.
My code currently ...
4
votes
1answer
190 views
Converting string to dict using Python ast library
I have been trying to convert a string of dictionary objects as given below
...
5
votes
5answers
998 views
Menu to save and load football team information
I am a newb, and whilst I'm sure my formatting can be improved, I really want to know, how I can re-use my code for this simple program. The objective is simple, football game with a menu, that allows ...
8
votes
2answers
72 views
Racetrack game with reading the track from a file
For this community challenge I made the racetrack game. I'm reading the race data from a text file, which is available here. This is only playable by entering the velocity at the console.
I've got ...
2
votes
3answers
847 views
XML serialization helper class
Yesterday was JSON serialization, today is XML serialization.
I've taken some of the suggestions from there and made modifications, as well as making other modifications that were not suggested but ...
2
votes
1answer
187 views
JSON serialization helper class
I wrote this class to one-line all my JSON serialization, and I'm curious of any input on it.
It's only responsible for serializing/deserializing any type to/from JSON.
The comments and code are ...
6
votes
2answers
220 views
Binary serialization library
I am currently working on a binary serialization library written in C++11 for a personal project. I'd really like to have a review about my design, my implementation and everything else. The library ...
8
votes
4answers
4k views
Conversion of hexadecimal string to string
Given a C# string which is a set of hexadecimal numbers such as:
string HexString = "202048656c6c6f20576f726c64313233212020";
Where those hexadecimal numbers ...
5
votes
1answer
446 views
Fastest De-/Serialise struct in .Net
I wrote this code to De- and serialise structures afap using IL generation (comments describes C# analogue). What can be improved here?
...
5
votes
2answers
140 views
Serialize/deserialize objects to and from database concurrently
I have a class which runs as spring bean in the container and its purpose is data persistence. In the overriden method ...
1
vote
1answer
49 views
Properly managing a collection from deserialized XML file throughout app's lifetime
I'm developing a WinForms app to manage some settings and profiles for multiple video games. The list of video games is specified by the user, and I'm trying to figure out how to properly maintain ...
5
votes
2answers
69 views
A tiny library for textual serialization of lists in Java - follow-up 3
See the previous iteration. I have incorporated the answer of h.j.k.. Now I have:
LineStringSerializationFactory.java:
...
5
votes
1answer
66 views
A tiny library for textual serialization of lists in Java - follow-up 2
See the previous iteration. See the next iteration.
I emphasized the fact that serialization routine may not return a string with new line character by using more or less explicit identifier. Moved ...
5
votes
2answers
61 views
A tiny library for textual serialization of lists in Java - follow-up
See the previous and initial iteration.
See the next iteration.
I have mainly refactored the code and made it a little bit robust (if serialization of a single object produces a string with new line ...
8
votes
2answers
154 views
A tiny library for textual serialization of lists in Java
Note: see the next iteration.
I have this tiny library for (de)serializing lists of objects. The requirement is that each object's state may be represented textually as a single line of text. Later ...
7
votes
1answer
115 views
Persist values for a known set of keys in Python
Use case: I sometimes write programs that want to store a little state between runs, e.g., "What was the last file selected last time this program ran?" I wanted a convenient way to track this state. ...
4
votes
1answer
63 views
Serializable Queue header only library
I was hoping someone could check the library I 'm working on to see if they could give any suggestions. My biggest issue right now is getting tuple to work with more than just the basic types and I ...
10
votes
1answer
410 views
Rendering an HTML form based on a specification in a string
Here's a brief explanation of my method:
Provide a string and parse it to HTML code respecting a specific format.
The accepted format is:
For dropdown menu : Test DropDown~Select:Options1; ...
2
votes
0answers
80 views
Serialize/deserialize a vector using insertion/extraction operators
I've never serialized a structure to a file before in C++, so I'm looking for critique on my first try at it.
My main concerns are:
It uses the streams space-delimited behavior. If a ...
1
vote
0answers
121 views
Serializing and deserializing objects in Java
I have a class that receives an Object object as a parameter. Then, I want to write two functions to serialize, and ...
4
votes
2answers
184 views
De-serializing and serializing objects to be sent over the network
I am serializing and de-serializing a class object within the class which is then sent over the network like this:
...