VIN Vehicle Identification Number, how to figure out the WMI part? - vin

I am trying to figure out how to breakdown a vehicle vin number.
There is an explanation of how a VIN is build (http://en.wikipedia.org/wiki/Vehicle_Identification_Number#Components_of_the_VIN) but it fails to explain what to do with manufacturers that only have 2 digits assigned instead of 3 digits.
If I understand correct what is written there then every VIN number must be 17 characters long, and the first 3 characters are the WMI (World Manufaturer Identification).
Then there is a list of WMI on the same page, but some manufacturers only have 2 characters in that list, not 3.
How to read such a VIN number ? Will it be only 16 characters long or how do I regognize that a WMI is 2 or 3 characters ?
for example nissan has WMI = JN which is only 2 characters.
2 VIN numbers for Nissan that I know that are valid are :
JN1UC4E26F9001391 and JNKCP0106TT541680
How can I know that for these 2 VIn numbers only the first 2 digits are to be read and used for the WMI ?

In you examples it is in fact 3 characters that Set the WMI information
JN1UC4E26F9001391
NISSAN MOTOR COMPANY, LTD. JN1,1N4 3995 RESEARCH PARK DRIVE ANN ARBOR MI 48104 PASSENGER CAR SEE MEMO 7/29/1986
JNKCP0106TT541680
NISSAN RESEARCH & DEVELOPMENT JN1,JNK 750 17TH STREET, N.W. WASHINGTON DC 20006 PASSENGER CAR ALL 1/13/1992
1st character- Identifies the country in which the vehicle was manufactured.
For example: U.S.A.(1or 4), Canada(2), Mexico(3), Japan(J), Korea(K), England(S), Germany(W), Italy(Z)
2nd character- Identifies the manufacturer. For example; Audi(A),
BMW(B), Buick(4), Cadillac(6), Chevrolet(1), Chrysler(C), Dodge(B),
Ford(F), GM Canada(7), General Motors(G), Honda(H), Jaquar(A), Lincoln(L), Mercedes Benz(D), Mercury(M), Nissan(N), Oldsmobile(3), Pontiac(2or5), Plymouth(P), Saturn(8), Toyota(T), VW(V), Volvo(V).
3rd character- Identifies vehicle type or manufacturing division.
Per VIN descriptor
This link contains the most current WMI information for all, this is were I got my data
WMI for all manufactures
In any Case it is not 3 or 2 for WMI it is
1 for country
2 for manufacturer
3 for type
this gets a little tricky because IF "2" = "N" that is not necessarily Nissan, for example 1N9 = NOMAD CUSTOM CYCLES INC.
Let me know if that helps or if you find a place to get VDS information

Your wiki page seems pretty clear that it's either a 3-character WMI, or a 2-character WMI followed by a 9.

There are an abundance of libraries out there, on GitHub and elsewhere, which are designed to decode VINs. "Do not do a thing already done."

Related

Odd results from Google Reverse Geocode API

Recently I've been occasionally receiving odd results from the Google Reverse Geocode API.
For example when looking up the address for coordinates 43.2379396 -72.44746565 the result I get is:
6HQ3+52 Springfield, VT, USA
In another case looking up 43.703563 -72.209753 results with:
PQ3R+C3 Hanover, NH, USA
Does anyone know what the initial 7 bytes of the returned address symbolize? When I receive this type of result it's always 4 bytes of alphanumeric data followed by a plus sign then 2 more alphanumeric bytes.
After some additional research I found that these are Plus Code addresses, a relatively new feature in Google Maps. These are used for places that don't have a street address. These seem to have some similarities to "what 3 words" addresses.

How to simulate a loop in Hive Sql?

I want to simulate a loop in Hive. The problem is that of link traversal.
Raw Data:
phone,name
1234,Sam
2345,John
3456,Max
7899,Sam
7899,Tim
8899,Tim
8898,Dan
8899,John
I am only interested in getting phone numbers.
If I take 1234,Sam and go to 7899,Sam that would be 1-hop because Sam used 7899 number too. Then if I go from 7899,Sam to 8899,Tim that would be 1-hop because 7899 was used by Tim and Tim also used 8899. Now where we started from, 1234, to where we are now, 8899, we are 2-hops away. I can do this with a shell script with loops but I am interested to find if this is possible to do purely in Hive. I want the loop to stop if any one criteria is met:
10 hops reached OR no new numbers detected
(If the conditions above are hard to implement, I can just have one condition - 10hops reached)
Visual representation:
1 hop:
1234 -> Sam
Sam linked to 7899
2 hops:
7899 -> Tim
Tim linked to 8899
so 1234 and 8899 are 2 hops away.
Any tips are welcome!

OpenRefine cell.cross creates column but fills zero rows

I have two projects with a column in common I am attempting to merge.
Project 1 has columns Date Published, Type, Story, Subtopics and Author
Project 2 has columns PageTitle, UniquePageviews and AvgTimeOnPage
PageTitle and Story have equivalent values. I want to add UniquePageviews and AvgTimeOnPage to Project 1.
When I use GREL forEach(cross(cell,"Project2","PageTitle"),v,v.cells["AvgTimeOnPage"].value)[0] (either manually or using VIB-Bits extension), I am notified that two new columns have been created ... but "by filling 0 rows." The new columns are blank except for the header, which is added correctly.
How do I get cell.cross to fill any of the rows it says it's filling?
Edit: Database samples here: https://imgur.com/a/fRGhhNw
Project 1:
Date published Type Story Subtopic(s) Author
4/30/2018 News in Brief Last year's solar eclipse set off a wave in the upper atmosphere Planetary Science, Earth Lisa Grossman
4/30/2018 News in Brief New genetic details may help roses come up smelling like, well, roses Plants, Genetics Susan Milius
4/30/2018 Science Visualized See (and hear) the stunning diversity of bowhead whales' songs Animals, Biophysics, Ecology Helen Thompson
4/29/2018 News New genetic sleuthing tools helped track down the Golden State Killer suspect Genetics, Science & Society Tina Hesman Saey
Project 2:
PageTitle UniquePageviews AvgTimeOnPage
The truth about animals isn't always pretty 63398 Sun Dec 31 00:03:06 EST 1899
Birds get their internal compass from this newly ID'd eye protein 53566 Sun Dec 31 00:03:30 EST 1899
Last year's solar eclipse set off a heat wave in the upper atmosphere 35496 Sun Dec 31 00:07:03 EST 1899
City heat is getting hazardous for humans 32199 Sun Dec 31 00:05:49 EST 1899
Finally got it to work. Lessons learned:
Use 2.8, not 3.0 beta
Transform smart quotes to regular quotes
value.replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/,"'")

Does the Luhn algorithm work for all mainstream credit cards? (Discover, Visa, Mastercard, Amex)

Reference: Luhn Algorithm
The Luhn Algorithm is a great way to quickly verify that the user typed their CC # in correctly.
However, I am concerned that there may be a subset of mainstream credit cards that do not use Luhn-Algorithm-friendly numbers.
I do have logging in place in our application to detect a pattern in all Luhn-Algorithm-rejections, but I'd rather know definitively.
Almost.
China UnionPay and one kind of Diners Club card (enRoute) do not use Luhn validation. (LazyOne’s answer is wrong about Diners Club.)
Nearly everyone else does.
Citing Wikipedia's 'Bank card' page:
Don't validate at all:
Diners Club enRoute
China UnionPay
Validate with Luhn 2:
American Express
Bankcard
Diners Club Carte Blanche
Diners Club International
Diners Club United States & Canada
Discover Card
InstaPayment
JCB
Laser
Maestro
Dankort
MasterCard
Solo
Switch
Visa
Visa Electron
Yes -- it works for all mainstream card types.
I have a custom PHP class to handle card data that was compiled from various "validate card number" and alike functions from few programming languages + information from Wikipedia & some Payment Processing systems. It successfully validates test card numbers (every payment system has few of such numbers) for these card types:
VISA debit / credit
VISA Electron
VISA Delta
MasterCard
AMEX
Maestro
Switch
Solo
Diners Club
Discover
JCB
The LUN check works on most credit cards. It is a modulus 10 check digit system to guarantee that the card number has been accurately read/recorded (mag stripe, virtual terminal or manual entry in the old days of the manual card imprinter).
Back in the days of manual data entry, these check systems were used to make sure that keys like UPS's pickup book numbering system were accurately entered (modulus 7 check digit).
It is even used in barcoding systems like code 128 which needs a modulus 103 digit added to the encoded data string to verify that the code was read right.

Tracking number patterns

Is there any place to get patterns for shipping tracking numbers for all shipping companies like UPS,FedEX, DHL, AirBorne, USPS ...
Fedex: 12, 14, 15, 20, 22 digits are all valid tracking number
UPS: 1Z + 16 digits or begin with W,T,H + 10 digits
DHL: 10 digits ONLY (if u mention the express shipping, as DHL also have cargo, sea shipment etc)
usps: https://tools.usps.com/go/TrackConfirmAction!input.action
Notice that as far as i know, there is not a complete list there.
If anyone know the new tracking number format, please let me know too.
As I run a startup http://www.aftership.com which also need to detect the tracking number pattern.
Fedex:
XXXXXXXXXXXX (12 numbers)
DHL:
International Air Freight Shipments -
7 digit HAWB number 1234567
International Ocean Shipments - 9
character HBL number SEA123456
U.S. Domestic Shipments* – 3
character origin code and HAWB
number, which can be up to 10 digits
in length. SEA1234567
DHL Tracking Number Information Page
Canadian Postal Service:
Canadian Postal Service Tracking Information Page
UPS:
Begins with 1Z
If it's UPS, Fedex or USPS, you can send the number into Google and get the type from the Google result.
Airborne is now DHL.