Want to show your appreciation?
Please a cup of tea.

Monday, September 24, 2012

International Country Codes

Shamelessly copied from http://www.indiandata.com/international_country_codes.html. It is hard to find it by just googling.

Country 2-Letter 3-Letter 4-Digit
Afghanistan AF AFG 4
Albania AL ALB 8
Algeria DZ DZA 12
American Samoa AS ASM 16
Andorra AD AND 20
Angola AO AGO 24
Anguilla AI AIA 660
Antarctica AQ ATA 10
Antigua And Barbuda AG ATG 28
Argentina AR ARG 32
Armenia AM ARM 51
Aruba AW ABW 533
Australia AU AUS 36
Austria AT AUT 40
Azerbaijan AZ AZE 31
Bahamas BS BHS 44
Bahrain BH BHR 48
Bangladesh BD BGD 50
Barbados BB BRB 52
Belarus BY BLR 112
Belgium BE BEL 56
Belize BZ BLZ 84
Benin BJ BEN 204
Bermuda BM BMU 60
Bhutan BT BTN 64
Bolivia BO BOL 68
Bosnia And Herzegowina BA BIH 70
Botswana BW BWA 72
Bouvet Island BV BVT 74
Brazil BR BRA 76
British Indian Ocean Territory IO IOT 86
Brunei Darussalam BN BRN 96
Bulgaria BG BGR 100
Burkina Faso BF BFA 854
Burundi BI BDI 108
Cambodia KH KHM 116
Cameroon CM CMR 120
Canada CA CAN 124
Cape Verde CV CPV 132
Cayman Islands KY CYM 136
Central African Republic CF CAF 140
Chad TD TCD 148
Chile CL CHL 152
China CN CHN 156
Christmas Island CX CXR 162
Cocos (Keeling) Islands CC CCK 166
Colombia CO COL 170
Comoros KM COM 174
Congo, Democratic Republic Of CD COD 180
Congo, People's Republic Of CG COG 178
Cook Islands CK COK 184
Costa Rica CR CRI 188
Cote D'ivoire CI CIV 384
Croatia HR HRV 191
Cuba CU CUB 192
Cyprus CY CYP 196
Czech Republic CZ CZE 203
Denmark DK DNK 208
Djibouti DJ DJI 262
Dominica DM DMA 212
Dominican Republic DO DOM 214
East Timor TL TLS 626
Ecuador EC ECU 218
Egypt EG EGY 818
El Salvador SV SLV 222
Equatorial Guinea GQ GNQ 226
Eritrea ER ERI 232
Estonia EE EST 233
Ethiopia ET ETH 231
Falkland Islands (Malvinas) FK FLK 238
Faroe Islands FO FRO 234
Fiji FJ FJI 242
Finland FI FIN 246
France FR FRA 250
France, Metropolitan FX FXX 249
French Guiana GF GUF 254
French Polynesia PF PYF 258
French Southern Territories TF ATF 260
Gabon GA GAB 266
Gambia GM GMB 270
Georgia GE GEO 268
Germany DE DEU 276
Ghana GH GHA 288
Gibraltar GI GIB 292
Greece GR GRC 300
Greenland GL GRL 304
Grenada GD GRD 308
Guadeloupe GP GLP 312
Guam GU GUM 316
Guatemala GT GTM 320
Guinea GN GIN 324
Guinea-Bissau GW GNB 624
Guyana GY GUY 328
Haiti HT HTI 332
Heard And Mc Donald Islands HM HMD 334
Honduras HN HND 340
Hong Kong HK HKG 344
Hungary HU HUN 348
Iceland IS ISL 352
India IN IND 356
Indonesia ID IDN 360
Iran IR IRN 364
Iraq IQ IRQ 368
Ireland IE IRL 372
Israel IL ISR 376
Italy IT ITA 380
Jamaica JM JAM 388
Japan JP JPN 392
Jordan JO JOR 400
Kazakhstan KZ KAZ 398
Kenya KE KEN 404
Kiribati KI KIR 296
Korea, North KP PRK 408
Korea, South KR KOR 410
Kuwait KW KWT 414
Kyrgyzstan KG KGZ 417
Lao People's Democratic Republic LA LAO 418
Latvia LV LVA 428
Lebanon LB LBN 422
Lesotho LS LSO 426
Liberia LR LBR 430
Libyan Arab Jamahiriya LY LBY 434
Liechtenstein LI LIE 438
Lithuania LT LTU 440
Luxembourg LU LUX 442
Macau MO MAC 446
Macedonia, The Former Yugoslav Republic Of MK MKD 807
Madagascar MG MDG 450
  MW MWI 454
Malaysia MY MYS 458
Maldives MV MDV 462
Mali ML MLI 466
Malta MT MLT 470
Marshall Islands MH MHL 584
Martinique MQ MTQ 474
Mauritania MR MRT 478
Mauritius MU MUS 480
Mayotte YT MYT 175
Mexico MX MEX 484
Micronesia, Federated States Of FM FSM 583
Moldova, Republic Of MD MDA 498
Monaco MC MCO 492
Mongolia MN MNG 496
Montserrat MS MSR 500
Morocco MA MAR 504
Mozambique MZ MOZ 508
Myanmar MM MMR 104
Namibia NA NAM 516
Nauru NR NRU 520
Nepal NP NPL 524
Netherlands NL NLD 528
Netherlands Antilles AN ANT 530
New Caledonia NC NCL 540
New Zealand NZ NZL 554
Nicaragua NI NIC 558
Niger NE NER 562
Nigeria NG NGA 566
Niue NU NIU 570
Norfolk Island NF NFK 574
Northern Mariana Islands MP MNP 580
Norway NO NOR 578
Oman OM OMN 512
Pakistan PK PAK 586
Palau PW PLW 585
Palestinian Territory, Occupied PS PSE 275
Panama PA PAN 591
Papua New Guinea PG PNG 598
Paraguay PY PRY 600
Peru PE PER 604
Philippines PH PHL 608
Pitcairn PN PCN 612
Poland PL POL 616
Portugal PT PRT 620
Puerto Rico PR PRI 630
Qatar QA QAT 634
Reunion RE REU 638
Romania RO ROU 642
Russian Federation RU RUS 643
Rwanda RW RWA 646
Saint Kitts And Nevis KN KNA 659
Saint Lucia LC LCA 662
Saint Vincent And The Grenadines VC VCT 670
Samoa WS WSM 882
San Marino SM SMR 674
Sao Tome And Principe ST STP 678
Saudi Arabia SA SAU 682
Senegal SN SEN 686
Seychelles SC SYC 690
Sierra Leone SL SLE 694
Singapore SG SGP 702
Slovakia SK SVK 703
Slovenia SI SVN 705
Solomon Islands SB SLB 90
Somalia SO SOM 706
South Africa ZA ZAF 710
South Georgia & South Sandwich Islands Gs SG SGS 239
Spain ES ESP 724
Sri Lanka LK LKA 144
St. Helena SH SHN 654
St. Pierre And Miquelon PM SPM 666
Sudan SD SDN 736
Suriname SR SUR 740
Svalbard And Jan Mayen Islands SJ SJM 744
Swaziland SZ SWZ 748
Sweden SE SWE 752
Switzerland CH CHE 756
Syrian Arab Republic SY SYR 760
Taiwan TW TWN 158
Tajikistan TJ TJK 762
Tanzania, United Republic Of TZ TZA 834
Thailand TH THA 764
Togo TG TGO 768
Tokelau TK TKL 772
Tonga TO TON 776
Trinidad And Tobago TT TTO 780
Tunisia TN TUN 788
Turkey TR TUR 792
Turkmenistan TM TKM 795
Turks & Caicos Islands TC TCA 796
Tuvalu TV TUV 798
Uganda UG UGA 800
Ukraine UA UKR 804
United Arab Emirates AE ARE 784
United Kingdom GB GBR 826
United States US USA 840
United States, Minor Islands UM UMI 581
Uruguay UY URY 858
Uzbekistan UZ UZB 860
Vanuatu VU VUT 548
Vatican City State VA VAT 336
Venezuela VE VEN 862
Vietnam VN VNM 704
Virgin Islands, British VG VGB 92
Virgin Islands, U.S. VI VIR 850
Wallis & Futuna Islands WF WLF 876
Western Sahara EH ESH 732
Yemen YE YEM 887
Yugoslavia YU YUG 891
Zambia ZM ZMB 894
Zimbabwe ZW ZWE 716

Sunday, September 23, 2012

EDI For 3PL

A listing of the most commonly used 3PL (Third Party Logistics Provider) EDI transactions.

Terminology

  • depositor: a manufacturer, seller or wholesaler that owns the product that need to be stored in warehouse.
  • customer: a buyer, consumer or retailer that purchases the product.

3PL Process

In general, third-party warehouses store products for depositor who then instruct the warehouse to ship to other locations. This process, utilizing EDI, generally follows this sequence:

  • Depositor transmits production information to warehouse for reference in future communication. This is done using EDI 888 Item Maintenance transaction.
     
  • Prior to shipping product to the warehouse, the manufacturer sends a shipment notification to indicate to the warehouse that an order is on its way. This is done using the EDI 943 Warehouse Stock Transfer Shipment Advice transaction. (Note: this ship notice is different from 856, which is for notice of delivery to customer.)
     
  • When the shipment arrives, the warehouse confirms this by transmitting an EDI 944 Warehouse Stock Receipt transaction.
     
  • The depositor periodically submits an EDI 940 Warehouse Shipping Order to the warehouse. This transaction directs the warehouse to ship product from its stock, usually to customer locations. depositor may also use this transaction to change or cancel the shipping order.
     
  • The warehouse confirms shipment of the order using a EDI 945 Warehouse Shipping Advice transaction.
     
  • If customer is a business entity, EDI 856 Ship Notice/Manifest transaction is generally required to be transmitted by either the depositor or the warehouse.
     
  • Warehouse or depositor may use EDI 947 Warehouse Inventory Adjustment Advice transaction to information each other of a quantity or status change to inventory records.
     
  • Warehouse and depositor can utilize EDI 846 Inventory Inquiry/Advice to reconcile the inventory.

X12 EDI Documents

Table below listed the relevant X12 EDI transactions in the order of the transaction number.

X12 Name Description
846 Inventory Inquiry/Advice This transaction set can be used in the following ways:
  1. for a seller of goods and services to provide inventory information to a prospective purchaser, with no obligation to the purchaser to acquire these goods or services;
  2. for a representative of a seller of goods and services to supply inventory information to that seller;
  3. for one location to supply another location with inventory information; and
  4. for an inquiry as to the availability of inventory with no obligation on the seller of goods and services to reserve that inventory.
856 Ship Notice/Manifest This transaction is more commonly called the Advance Ship Notice or ASN. It is utilized to electronically communicate the contents of a shipment to another trading partner. It is sent in advance of a shipment arriving at the other trading partner’s facility.
888 Item Maintenance This transaction set is used to enable a manufacturer, supplier, broker, or agent to provide detailed finished goods product information to a partner in a consumer goods market. This transaction set can be used to provide information about new products or changes in existing product specifications. Price changes will not be sent with this transaction set, but can be sent with the Price Change Transaction Set (879)
940 Warehouse Shipping Order This transaction set is used to instruct remote warehouses to ship orders. It is commonly used by a depositor, to authorize a warehouse to make a shipment to a customer. The 940 may also be used to confirm a shipment, modify a shipment or cancel a previous shipping order.
943 Warehouse Stock Transfer Shipment Advice This transaction set is an advance ship notice to a remote warehouse that a transfer shipment has been made to the warehouse. The 943 transaction may also be used by depositor to authorize a warehouse to accept a return from a customer.
944 Warehouse Stock Receipt This transaction set is an acknowledgement from warehouse to the depositor that its transfer shipment has been received.
945 Warehouse Shipping Advice This transaction set, also known as Warehouse Shipping Order Confirmation, provides confirmation of a shipment. It is used by warehouse to notify the depositor that a shipment was made.
947 Warehouse Inventory Adjustment Advice This transaction set is used to inform a warehouse/depositor of a quantity or status change to inventory records. This transaction set provides detail information concerning the internal adjustments which occur between a warehouse and a depositor.
997 Functional Acknowledgment This transaction set, known as the Functional Acknowledgment or FA, is sent as a response to other EDI transactions received. An EDI 997 serves as a receipt, to acknowledge that an EDI transaction, or a group of transactions, was received by the remote party.

Friday, May 11, 2012

C# to Java–Type System

This is one of the informal discussions with a group undergoing the transition from C# to Java.

Type System

 

C#

The common type system in the .NET Framework supports the following five categories of types: class, delegate, structure(struct), enumeration(enum) and interface.

Except interface type by itself cannot create concrete object, types are further categorized by data type into value type and reference type. A value type holds the data within its own memory allocation. A reference type contains a pointer to another memory location that holds the data. Class and delegate are reference types and struct and enum are value types.

All .Net types except interfaces inherit from ultimate base class System.Object.

All primitive types are structures, which also inherits from System.Object.

.Net Array is a class type.

Java

There are two kinds of types in the Java programming language: primitive types and reference types.

There is also a special null type, the type of the expression null, which has no name. The null reference can always be cast to any reference type. In practice, the programmer can ignore the null type and just pretend that null is merely a special literal that can be of any reference type.

Java primitive type does not inherit from java.lang.Object and Java has no user defined value type. This is a disadvantage over .Net.

Java language specification categorized reference type by how they appear in language structure. But essentially, reference type can be further categorized into class type and interface type.

Java enum is a special class type. This is a big advantage over .Net.

Java has no delegate. Needless to say lamba expression. This is a huge disadvantage. The workaround is to use interface and anonymous class. Example:

public Comp() {
    List<String> foo = new LinkedList<String>();
    Collections.sort( foo, new Comparator<String>() {
        public int compare( String s1, String s2 ) {
            return s1.compareTo( s2 );
        }
    });
}

with many limitations.

Inheritance

Although .Net allows multiple inheritance of classes, C# language allows class to inherit form only one base class and can implement multiple interfaces. Interface can in turn inherit multiple interfaces. Java is same as C# on this.

Misc

C# use sealed keyword to prevent other class from inheriting it. Java uses final keyword.

C# use static keyword to make a class not insatiable. Java has no counterpart for this. The workaround is to use private constructor. Java has complete different use of static modifier of class and we’ll cover in a later session about member class.

The meaning of abstract class is identical in C# and Java

Thursday, May 10, 2012

C# to Java–Access Modifiers

This is one of the informal discussions with a group undergoing the transition from C# to Java.

Assembly vs. .Jar File

.Net code need to be packed into an assembly to be useful. Java has no concept of this. Java’s runtime code unit is class file. The closest thing in Java as to the .Net assembly is a .jar file, which is merely a zip of a logically related group of class files. Metadata about the .jar file can also be pack in the .jar file. Hence, java has no version and assembly access scope.

Access Modifiers

 

C#

C# has four access modifiers: public, protected, internal and private.

protected and private modifiers are not applicable to top level types.

protected is only accessible by derived types.

The default access is internal for top level types, public for interface members, and private for everything else.

You can use both internal and protected, which gives you both access.

Java

Java has only three access modifiers: public, protected and private. But when you don’t give an access modifier, it means package access. Package access only allow classes defined in the same package to have access.

protected and private modifiers are not applicable to top level types which is same as .Net

protected gives package access plus accessible by derived classes.

The default is always package access in Java. But bear in mind that any body can define the same package name. So the access control is merely by convention and should be used as a security measure.