HERE maps: difference between positive and negative link ids - here-api

What is the difference between positive and negative link ids. For example link ids 781299767 and -781299767 have the same address, but only -781299767 has a speed limit. This can be seen from http://route.st.nlp.nokia.com/routing/6.2/getlinkinfo.xml?linkIds=781299767,-781299767&app_id=DemoAppId01082013GAL%20&app_code=AJKnXv84fjrb0KIHawS0Tg

The documentation of LinkIdType defines the presence of the minus sign
"Permanent ID which references a network link. When presented with a minus sign
as the first character, this ID indicates that the link should be traversed in the
opposite direction of its default coding (for example, walking SW on a link that is coded as one-way traveling NE)."

Related

Are initial and final permutation in DES always done in the same order?

Everywhere on the internet, it is found that the 58th bit position takes first position in initial permutation. Also, the 40th bit position takes first position in final permutation. Is this always the same in every case? I mean is this done randomly or in a particular order (the same order)?
enter image description here
Ciphers doesn't work randomly. In the case of DES, the tables (PC1, PC2, IP, E, P, IP-1, but also the shifts and the S boxes) are always the same. You can find them in Wikipedia; here's NIST official documentation.
This documentation also contains a lot of test sets to validate correct DES implementations (with a small error... I challenge you to find it out!).
Anyway, this is another useful resource to fully understand DES.

What is the information entropy of a node in a symbolic graph

I'm attempting to develop a better intuition of information entropy. The example case I would like to look at is a symbolic graph where the leaves are more specific entity types than the root.
If each node in the graph can be recorded using the same number of bits eg.. a 64 bit id handle.. would the more specific 'Jack Pine' node be considered to be higher or lower entropy than the 'Tree' node?
Update 12 hours after post: Perhaps this concept can't be understood with entropy.. Assume the symbol 'jack pine' has more information in it than symbol 'tree' yet can be transmitted using the same number of bits - in this case the observer receiving the symbol is decompressing the information in their mind based on previous knowledge.. so receiving the symbol for 'jack pine' is giving them more information than receiving the symbol 'tree' because they understand a specific type of tree. Does this mean 'jack pine' is lower entropy because it has more information for a given signal and thus higher compression?
If I assume that each branch has equal probability, then going from tree to a kind of tree adds one bit of entropy. Going from a pine tree to a kind of pine tree adds another bit of entropy. Knowing that it is a Jack Pine has two bits more entropy than just knowing that it is a Tree.

Maximum coin that can be collected in a grid

There is a grid G .
G(i,j)=-1 implies path blocked.
Otherwise G(i,j) = number of coins at (i,j).
Always start from point start point (0,0) goto end point (n,n) then come back to start point (0,0). Once coins at any location is collected it can't be collected again. However you can still have a path through that location.
What is the maximum number of coins that can be collected if you can travel in top, bottom, left, right directions?
I know how to get the maximum number of coins when you only have to go from (0,0) to (n,n) using recursion but not able to track which coins I have already collected while traveling from start to end.
Please suggest a good approach or refer to some source.
Task specification doesn't require the path to be shortest nor to avoid repeated visit of field. So if the point (n,n) is reachable from point (0,0), the result is effectively sum of all points reachable from them (which can be computed using Flood-fill algorithm); zero otherwise.
Frankly, I suppose you omitted some important constraint in the task specification. Until fixed, it's hard to guess which algorithm is the best solution (for example Dijkstra when looking for shortest path, dynamic programming when moves restricted to right and down etc.).
As your question does not have any restriction on how many steps can be performed. You only need to add up the value of all grids as you can potentially pick up all coins by walking over all grids.

Point of checkdigits in MRZs?

Not sure if this is the right subreddit to ask this question, but I will give it a shot. There is the ICAO standard for Machine Readable Zones as described here https://en.wikipedia.org/wiki/Machine-readable_passport. I don't see the point for check digits there.
If I have F instead of 5 for example in the MRZ code somewhere in the second line for example, all the checkdigits will be the same. What is the point in the first place for those check digits in the ICAO standard? Especially I don't see the point of the last check digits calculation since you could also calculate it by using the check digits from the second line and not all the letters/numbers.
Could someone explain why we need those checkdigits?
To be fair. This is not a subreddit. Anyway, there are multiple reasons that there are check digits inside the MRZ. The first reason is that automatic readers can check if the code is read well enough. The second reason is that it prevents a lot of fraud and identification theft. Some people that alter their travel documents do not know that there are check digits in place. So some people will get caught because they fail to edit the numbers.
Some countries now include PDF417 barcodes and/or QR-codes to reach better reads by machines. But keep in mind that not all governments/countries have access to high-tech devices, so the machine readable zone is still mandatory for a check with the naked eye.
Source: I work for a travel document verification company.
MRZ check digits are calculated on subsections of the entire MRZ. Each calculation serves as a check for each section. A final check digit is calculated on the sum of each sections and this digit serves as a double check of the individual check.
The below have same check digit of 8:
123456780
128456785
Whereas the subsection check digit matched after the tampering but the final check digit will detect this. Therefore, the final check digit adds additional robustness.
Although, I am wondering whether this visual check digit is mandatory because an eMRTD NFC chip BAC protocol also does a much stronger cryptographic check of the MRZ value.
UPDATES: My original claim that the composite check digit adds robustness to tampering is incorrect. Given the below TD1 MRZ:
IDSLV0012345678<<<<<<<<<<<<<<<
9306026F2708252SLV<<<<<<<<<<<4
JOHN<SMEAGOL<<WENDY<LIESSETTEF
An OCR scanner can either gave 0012345678 or OO12345678 for the document number portion and all check digits passes including the composite check digit. But there is no way to tell which document number is correct. It seems that an MRZ check digit has edge cases that cannot be helped.

Weighting output of cost function based on user input

Hi I am creating an android app that will generate a cycling route for users using a route finder.
I am trying to allow the user to either prefer distance or routes with cyclelanes present.
I have a slider from 0 to 10, where 0 means the user wants the shortest route, and 10 where the user wants roads with cyclelanes (if available).
The roads are represented as a graph and I have a function that calculate the shortest path from one point to another.
Given the output of this function: if there is a cyclelane present on the road I want to weight the result so that the higher the number the user chose, the lower the cost of the road and vice versa.
I am not really sure how weighted functions work.
if you calculate the route with dijkstra-like algorithm, in case of a cyclelane-edge, you should simply decrease the distance between two point by some value according to the slider-value

Resources