How should I pick which source specific multicast address to use? - udp

"The 232.0.0.0/8 (IPv4) and FF3x::/32 (IPv6) block is reserved for use by source-specific multicast."
So I assume this means I can use any address from 232.0.0.0 to 232.255.255.255 for source-specific multicasting. What should I be considering when I choose which address to use?

Choose whatever you want. It only has to be unique per sending system. There is no algorithm for this. It's source specific after all ☺

Related

How can I test the equality of two MediaStreams?

I'm wondering if there is a way to determine if two MediaStreams are equal.
What do you mean by "equal"?
I'd like to determine if the two streams are using the same hardware sources (Same microphone and camera are being used).
Acquiring streamB with the exact same constraints as streamA would mean they are equal.
Here is what I've tried so far:
comparing via the MediaStream id e.g.: streamA.id == streamB.id
This falls away since according to the spec:
When a MediaStream object is created, the User Agent must generate an identifier string, and must initialize the object's id attribute to that string. A good practice is to use a UUID [rfc4122], which is 36 characters long in its canonical form. To avoid fingerprinting, implementations should use the forms in section 4.4 or 4.5 of RFC 4122 when generating UUIDs.
Compare the id's of the MediaStreamTracks - same story, a UUID is generated per track.
Compare the tracks labels, which in the current Chrome contain names/identifiers of the hardware. This is very close to what I'm looking for, however (emphasis mine):
User Agents may label audio and video sources (e.g., "Internal microphone" or "External USB Webcam"). The label attribute must return the label of the object's corresponding source, if any. If the corresponding source has or had no label, the attribute must instead return the empty string
Is there a different approach I could take? Should I never end up in a situation where I compare two media streams? Would you say I can trust the label attribute?
Thanks for your time.
groupId together with kind is probably the closest thing you will get. Until you get multiple mics/cams on the same device...

How to identify Drive ID?

The new Google Drive Android API has 2 types of string IDs available, the 'resource' ID and the 'encoded' ID.
'encoded' id from DriveId.encodeToString()
"DriveId:CAESHDBCMW1RVVcyYUZKZmRhakIzMDBVbXMYjAUgssy8yYFRTTNKRU55"
'resource' id from DriveId.getResourceId()
"UW2aFJfdajB3M3JENy00Ums0B1mQ"
In the process I end-up with a string that can contain any one of them (result of some timing issues). My question is:
If I need to 'parse' the string in order to identify the type, is there a characteristic I can rely on? For instance:
'encoded' id will always start with 'DriveId:' substring
'resource' id will have some length limit
can I abuse error return from 'decodeFromString()'?
or should I form (pre-pend) the string container with my own tag? What could be the minimal 'safe' tag (i.e. what will never appear in the beginning of these ids) ?
Please point me in the right direction so I don't have to re-do it with the next release.
I have run into yet another issue that should be mentioned here so others don't waste time falling into the same pit. The 'resourceID' can be ported and will remain unique for the object it identifies, where 'encodedID' has only 'device' scope. Means that you CAN'T transfer 'encodedID' to another device (with the same account) and try to retrieve file/folder with it. So I assume it is unique to a Google Play Services instance.
Please do not rely on any formatting of either ID type. This are subject to change without notice.
If you need to use both, and track the differences between them you should have your own method of doing so within your app.
Really, you should probably always just store the encoded ID since this one is always guaranteed to present, and if it contains a resourceId, its easy to get back out.

binding-key with range on RabbitMQ

I need create binding key with range parameter, Have is Rabbitmq special characters for it? For example:
1. #.key.# - any names before and after key word
??.key.?? - for point to range like SQL (>10 <20).key.(>10 <20)
thx.
I do not believe it is possible to do what you want with a current exchange. You may be able to do it with a custom exchange though. You could try this one https://github.com/tonyg/script-exchange or write your own. Check out the HowTo on this page http://www.rabbitmq.com/how.html#going-further for writing your own custom exchange.

Can you store a theorem number in a variable?

I use \newtheorem and the numbering is done automatically. Sometimes in the text I'll refer to a theorem by this number. I'd like to have a variable equal to this number, so if the theorem number changes, the references will change also.
Yes, it works through the usual \label/\ref-mechanism:
\begin{theorem}\label{thm:foo} ...
That was Theorem~\ref{thm:foo}
(You'll need two runs of LaTeX for the number to settle, you'll get a message about changed references.) Label commands "tack onto" certain things like section headers, captions, items of enumerations and, indeed, theorems and friends.
There are also extensions that can automatically distinguish sections from subsections or figures, for that, see hyperref's \autoref or the cleveref package, but don't worry about it at this point.
You need to put a \label between the \begin{yourtheorem} \end{yourtheorem} and use \ref to refer to it as usual.
You can check this link for explanations with some broader context about theorems

variable name for the last part of a phone number

For the phone number: 234-567-8901, I would name variables like:
areaCode = "234";
exchange = "567";
What would an appropriate variable name be for "8901"?
Wikipedia calls it subscriber number.
It is called the line number.
Unless the software is to be used inside a telecommunications company (who would know the correct term), I would go for readability over technical correctness.
Since there is no consensus on the exact term or at least a commonly used name, I would choose something like "fourDigits" over a technically correct term "line number", "extension", "suffix", or "Subscriber line number (SLN)."
From http://en.wikipedia.org/wiki/North_American_Numbering_Plan
For the number 123-456-7890
123 Area Code
456-7890 Subscriber Number
456 Telephone Exchange or Central Office
7890 Line Number
I think the phone number segments are: area code, exchange, and extension. So, the third would be the extension.
This also has the last four digits referenced as the 'subscriber' number or 'station code'.
There is a large Wikipedia article (http://en.wikipedia.org/wiki/Phone_number) that gives a lot of history but no clear term for this part of the number. It may, in some cases, be a subscriber number and in some cases an extension.
Depends on why you're doing it.
If it's just for you, you can call it "mysticdragonnohala", as long as you can remember it.
If it's to be memorable within a team project, check with the other developers who'll have to deal with it.
If it's client-facing, then check with whoever deals with the client the most.
If it's for a uni course, just make sure it makes sense (or funny) and that it's clearly commented.
Personally I'd go for "line". But "personal", "specific", "individual" "final" and "local" would all make sense.
I've always heard it referred to as the "suffix".