If I wanted to define a file format, how would I go about that? - file-format

Say I come up with some super-duper way of representing some data that I think would be useful for other people to know about and use. Assume I have a 'spec' in some form, even if it might not be a completely formal one: ie, I know how this file format will work already.
How would I then go about releasing this spec to get comments and feedback based on it? How would I get it 'standardised' in some form?

Specifying file formats is difficult. If the data you want to store is trivial, it tends to be trivial. In general however, this is hardly the case. You can use the RFC structure and keywords, but I always found specifying a fileformat in prose a slow, difficult and boring task, also because reading it is likewise difficult.
My suggestion, if you want to follow this way, is to focus on blocks of information. Most of the difficuly is for entities that are optional, and present only if another condition happens, so try to exploit this when partitioning your data.
The best spec, IMHO, is real code with an uberperfect testsuite.
As for standardization, if enough people use it, it becomes a de-facto standard. you don't need an official stamp for it, although when the format is used enough, you could benefit from an official mime type.
To talk about it, well, it depends. I found useful to talk in terms of "object oriented" entities, and also in terms of relationships. Database-like diagrams are very useful on this respect.
Finally, try to find a decent already standard alternative first, or at least try not to deal with the raw bits. There are a lot of perfect container formats out there that free you of many annoying tasks. The choice of the container depends on the actual type of file format (e.g. if you need encryption, interleaving, transactions, etc).

There are a couple of ways I'd go about it, I think.
First, determine if there's a standards body (like W3C, or IEEE) that might be related to your file format. If there is, pitch it to them. I have no idea how receptive they'd be though.
Second, a standard is useless if nobody is using it. Get some momentum behind it. Write a blog post, twitter and make a website about it. Link on programming.reddit.com, and slashdot. Describe it to your friends and colleagues. Post it here on SO, and ask for feedback.
HTH.

Related

Where does React's `scryRenderedDOMComponentsWithClass` method name come from?

Working on testing a React component, I was reading the docs and found scryRenderedDOMComponentsWithClass. I'm having trouble understanding the function of this component because it's unpronounceable, so I don't understand how it's naming maps to a mental model of what it's doing. (There are a number of related names, such as scryRenderedDOMComponentsWithTag.)
What does the scry part of this method name refer to? Scary? Scurry? What concept is this name trying to illustrate?
Short answer
"Scry" in this context just means "find all". See this comment on ReactTestUtils.scryRenderedComponentsWithClass. It's a single word, not an abbreviation, and it's pronounced like "cry" but with an "s" at the beginning.
Longer (and nerdier) answer
Elsewhere in that same file, you'll see a reference to DOM.scry:
/**
* Todo: Support the entire DOM.scry query syntax. For now, these simple
* utilities will suffice for testing purposes.
* #lends ReactTestUtils
*/
zpao explains in a comment on a GitHub issue:
That's a reference to an internal Facebook module. It's basically querySelectorAll with fallback behavior for handling old browsers and special cases. It is pretty unremarkable and doesn't actually translate super well here (except maybe a scryRenderedDOMComponentsWithQSA or something, but meh). We're working on improving the testing in other ways so I don't think there's anything we really want to do with this right now.
jimfb takes it a bit further in another GitHub issue, explaining that the name is a reference to Dungeons & Dragons:
Back in the day, we had a bunch of D&D fans on the team.
For reference:
http://www.dandwiki.com/wiki/SRD:Scrying
http://www.dandwiki.com/wiki/SRD3e:Scry_Skill
https://en.wikipedia.org/wiki/Scrying
Historically, we've used scry to indicate a helper that finds a set of results. As the framework matures, we should start choosing function names based on what the functions actually do instead of fantasy words that have very little meaning to the typical developer.
Though I would agree that the word has very little meaning to most, it's worth noting that "scry" is a real English word:
scry
[skrahy]
verb (used without object), scried, scrying.
to use divination to discover hidden knowledge or future events, especially by means of a crystal ball.
Interestingly, according to the data from Google's Ngram Viewer, it seems that the word fell out of normal usage in the early 19th century and then wallowed in obscurity until the 1980s, presumably after D&D gained popularity:
So I can't say I object to jimfb calling it a "fantasy word", especially considering the kind of imagery my imagination conjures up when I hear it.

Extending MultiMap supported number of types

I'm considering extending the MultiMap methods in Dapper to support more than 5 types. Was just curious as to whether there was a technical/performance reason for 5 or was it just an arbitrary number?
It was fairly arbitrary, and due in part to some implementation particulars that make it pretty awkward to extend arbitrarily - in particular because it uses generics. Changing to an implementation that doesn't use generics would allow a more type-array based approach, but then the lambdas etc (to stitch the data back together) become pretty ugly. There are, IIRC, some pending things in the pull request queue relating to this, but I have not had much available time to review them as of yet.
Also: arguably, if you're doing a query that involves that many types, you're probably already doing something pretty complex; it is hard to expose a friendly API for arbitrarily complex systems.
Just wanted to make you aware that more types have already been supported. (Just helping you NOT reinvent the wheel)
https://code.google.com/p/dapper-dot-net/issues/detail?id=50
At the bottom of the page you can get a git-hub change.
Matt

How to model the state "needs discussion" for a bug/feature in Bugzilla 3.0.x

In our group, we have to model the state "needs discussion" for Bugzilla.
Therefore, a custom RESOLVED - to be discussed status was introduced. The appropriate group of people searches for issues that have this sort of "resolution" status and discusses these offline.
In my opinion, this is not the proper way as the bug/feature clearly is not resolved if there still is need for discussion. This is also reflected in the standard life cycle of a bug. It is sort of misleading, as "needs discussion" items show up in your list of resolved bugs.
One way I can think of, would be to make a sort of "virtual user", representing the group that has to be involved in the discussion. This has the advantage, that one can search for the bugs easily. One could also setup a mailing list to notify the users.
I wonder how one can appropriately model this needs discussion state of a bug in Bugzilla 3.0.x. (And: what is the Mozilla-way solution?)
As with any software system there are a multitude of ways to address your need.
Before you start with mechanism it would be good to think about requirements.
Do you want bugs the need discussion to be counted as "open" still, or do you consider them "resolved". Do you even collect those types of metrics?
The requirements I derive from your question are
Don't want to see them in normal searches
Do want to be able to see them when looking explicitely
Need to be able to finalize the discussion, and "bring the bug back" to normal
Would like to notify people that there is a discussion to be held
Would like the bugs to not look like they are resolved
If those are really the requirements, and you don't care that "for discussion" bugs are showing up as resolved for metrics etc, then I think what you have is probably good enough, except for point 5.
Some other alternatives
Create a "Discussion" product (or component).
Create a custom lifecycle (I wouldn't recommend that though).
Assign to the "Discuss-me" group/user
Use a "super bug", and mark the bugs a blocking the "Discussion super bug"
Create a "discuss this issue" bug, and mark the bug as blocked by the discussion (this reflects reality the closest, but that doesn't make it the best option).
But, as I say, think about what you're trying to achieve first, and then choose the mechanism based on that. There are different trade-offs around the amount of bug-fiddling you have to do to make them all work :-).

Do implementations (preferably open source) of the "Society of Mind" model exist

I have been fascinated by Minsky's "Society of the Mind" for now close to two decades. However, I just realized that I have not come across any general implementation of the model (and preferable an implementation that is accessible and in the open source).
I recently ran into this article by Push Sing (now tragically deceased, student of Minsky), http://web.media.mit.edu/~push/ExaminingSOM.html where he also notes that such an implementation does not exist.
I wonder if someone knows differently and if such a project or corpus of software does exist.
Note: I am aware of SOAR, ACT-R, Cyc, etc.
Thanks.
I think that Minsky's "Society of the Mind" model is more literature and aspirational than an actual model. It has lots of systems, information flows and controls, but there isn't anything that you could implement without doing a lot of invention. Once you put it all together, you'd have a big data flow network, but you wouldn't have any data, so you would then need to fill it with representations of facts, concepts, connections, and so on. Then you would need to figure some way of having inputs and outputs that are understandable.
Let's say you built it --- what then? There is no obvious way to test it. It's unlikely that you would suddenly get consciousness pouring out. The only way to drive new action would be to feed new input, but it's unclear what sort of output would result. Minsky would probably smile and say that the same is true of a human baby. But at least with children we have a good idea that they will being to exhibit some kind of intelligence beyond stimulus response.
Still, if you have the time, why not give it a try?

Modelling C applications

I would like to know if there are any tools that can help me model C applications i.e. Functional programming.
E.g. I'm currently building a shared library.
But to communicate my design visually, I need something like UML. I would like to do this so that the person reviewing my design need not read through 100s of pages of functions, variables and so on.
I have read about UML for C, which I'm considering.
If there is anything better out there, please let me know.
The bottom line is to visualize the design of C applications and modules without reading through 100s of pages of text, because it takes time and is difficult for the reviewers.
Any help in this area from the experts here would be much appreciated.
Thanks.
A well written text documentation brings you a far. Much further than any UML diagram could ever achieve.
You should split this in two parts:
What do you want to say?
What's the best way to saying it?
Whatever formalism you use to answer the second part, you should be sure it's not ambigous.
The good of UML is that a lot of semantic is already defined by the language so you don't have to include a definition of what those boxes, lines and arrows mean in a collaboration diagram.
But most importantly, documenting something means create a path for others to understand the subject you are documenting. A very precise description that offers no clue on how to read it is as good as none. So, use UML, Finite state machines, ER diagrams, plain English, whatever you want but be sure to include a logical path that your "readers" can follow to understand what's going on.
I had a friend that was a fan of "preciseness at all cost" and it would ask us to go through all the details before some sort of meaning would emerge.
I once ask him to do this experiment: on his next trip to an unknown city, he would have to carry the most precise map he could get. Much better, he would have to carry a 1:1 map of the city with every single detail exactly reported in scale. That way he couldn't get lost!
He declined but I would love to see him trying to use that map. Just even folding it! :)
Whatever you like. It's not a standard but many devs use it and understand it. If it does help you to communicate with other people and document your work -> its for you. If it just takes too much time and you think it's not effective, drop it. Also, don't bother with all details, as long as it resembles UML and your team can work with it, it's fine.
It's meant to help you, not waste you time.

Resources