New answers tagged

0

I think it might help to realize that Validable and Validator are interfaces that relate to the validation of a single entity, and that you are now trying to force the validation of a composite of entities into this design. Your Validator should only validate the event, do not try to use it to validate the rules for creating the event. Make a distinction ...


0

It would need to seek the largest possible subsets of topics, subject to matching a minimum number of students. So you essentially have 2 criteria. Let's look at "largest possible subset" first: This is brute force, unfortunately. In other words, you don't know the largest group until you've tallied all of the results. (Except you could optimize on ...


2

You need a clustering algorithm. The basic idea is that you want to treat each student's data as an n-dimensional coordinate, e.g. 30-dimensional coordinate in this case. So if you had 3 dimensions, you could have a student at x,y,z: 1,1,0; another one at 0,1,1, etc. Distance between them could be found using euclidean formula. Distance between ...


-1

To find out what is happening with a http request, simply open the Inspector on Google Chrome and go to the Network tab, before you initiate the request. In the resulting request and response, you can see the request under Headers when you click on the entry (Bilateral_TS.aspx). You see how this is a POST request and it submits lots of Form Data at the ...


2

You have several choices which are based on your needs. You can hard code the data. This is done quite often in unit/integration tests and is a valid way of storing this data. It makes it quite difficult to change, especially for a BA/non-developer. You can store it in a file of some sort. The format could be JSON or XML or CSV if you like. If you want ...


3

First of all, I think your code is decent and readable. A couple of things that I see wrong with this implementation here: You're implicitly defining variables using the var in the global space. I would suggest changing these to their actual types. var is reserved for local implicit definitions, and actually this won't compile. See this question for a more ...


1

Advice 1: Consider using std::unordered_map (explanation on en.cppreference.com) if you need fast lookup and don't need sorting by key. In C++, std::unordered_map is an implementation of the hash table that you have learned from the "data structures and algorithms" class. On the other hand, std::map is a balanced binary search tree. Advice 2: Given a ...


1

XML and to a lesser extent JSON is probably the best options out there if you want a human readable format. However, human readable also means human editable, which in turn means having people make changes that are invalid and then having to provide support to allow these humans to figure out their mistakes. Both XML and JSON do not solve the format ...


2

Ignoring the specific CAD issue, but taking into account that this use case could potentially generate rather large files, I would recommend looking into protobuf. It's a rather compact binary format with easy versioning for your future needs: ... language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but ...


2

Putting too many bytes into a QR-code is not a good idea. The generated QR-code will be big and difficult to manage and read. A better strategy is to link the data into an URL and turn the URL into a QR-code; there is no limit on the URL linked resource. You can put images, SVG, html, text file... If your QR-code needs to represent structured information ...


0

You have three options for storage on an Android device: Shared Preferences Shared Preferences is a Key/Value store, intended to store a small amount of settings type data. It supports primitive types like strings and numbers, stored in an XML format. Shared Preferences are available throughout the application, and they persist between sessions. File ...


7

I've had great success using SQLite databases as a file format for graphics applications. Its both very reliable, and being a standard format, its contents are easily viewed/converted by external programs.


5

JSON is simple and portable. External tools won't have any problems reading or writing it. You won't have any problems yourself reading and writing the data on any architecture, which is very nice. It is also very easy to be compatible with older and newer version, often just by ignoring items that you don't understand. JSON is a bit verbose if you store a ...


6

First thing I would check is if using an existing CAD format would not be sufficient. That would not only prevent you from reinventing the wheel, but also improve the interoperability with other CAD programs. Moreover, adapting the terms of such a format like "Layers" and "Entities", instead of using terms like "layouts" and "patterns" (which have typically ...


2

Single source of truth In information systems design and theory single source of truth (SSOT), also known as single point of truth (SPOT) refers to the practice of structuring information models and associated schemata such that every data element is stored exactly once (e.g., in no more than a single row of a single table). Any possible linkages ...


4

The principle you're defending is that of a "Single Source Of Truth". The corresponding antipattern doesn't have such a general name. Violating DRY ("don't repeat yourself") is sometimes called WET ("write everything twice"). In databases, violating normal form is called denormalization (and is sometimes good practice when trading off time versus space). ...



Top 50 recent answers are included