Best Python code snippet using tappy_python
demo.sample.data.products.ts
Source:demo.sample.data.products.ts  
1export const sampleProducts = [2    {3        "ProductID": 1,4        "ProductName": "Chai",5        "SupplierID": 1,6        "CategoryID": 1,7        "QuantityPerUnit": "10 boxes x 20 bags",8        "UnitPrice": 18,9        "UnitsInStock": 39,10        "UnitsOnOrder": 0,11        "ReorderLevel": 10,12        "Discontinued": false,13        "Category": {14            "CategoryID": 1,15            "CategoryName": "Beverages",16            "Description": "Soft drinks, coffees, teas, beers, and ales"17        },18        "FirstOrderedOn": new Date(1996, 8, 20)19    },20    {21        "ProductID": 2,22        "ProductName": "Chang",23        "SupplierID": 1,24        "CategoryID": 1,25        "QuantityPerUnit": "24 - 12 oz bottles",26        "UnitPrice": 19,27        "UnitsInStock": 17,28        "UnitsOnOrder": 40,29        "ReorderLevel": 25,30        "Discontinued": false,31        "Category": {32            "CategoryID": 1,33            "CategoryName": "Beverages",34            "Description": "Soft drinks, coffees, teas, beers, and ales"35        },36        "FirstOrderedOn": new Date(1996, 7, 12)37    },38    {39        "ProductID": 3,40        "ProductName": "Aniseed Syrup",41        "SupplierID": 1,42        "CategoryID": 2,43        "QuantityPerUnit": "12 - 550 ml bottles",44        "UnitPrice": 10,45        "UnitsInStock": 13,46        "UnitsOnOrder": 70,47        "ReorderLevel": 25,48        "Discontinued": false,49        "Category": {50            "CategoryID": 2,51            "CategoryName": "Condiments",52            "Description": "Sweet and savory sauces, relishes, spreads, and seasonings"53        },54        "FirstOrderedOn": new Date(1996, 8, 26)55    },56    {57        "ProductID": 4,58        "ProductName": "Chef Anton's Cajun Seasoning",59        "SupplierID": 2,60        "CategoryID": 2,61        "QuantityPerUnit": "48 - 6 oz jars",62        "UnitPrice": 22,63        "UnitsInStock": 53,64        "UnitsOnOrder": 0,65        "ReorderLevel": 0,66        "Discontinued": false,67        "Category": {68            "CategoryID": 2,69            "CategoryName": "Condiments",70            "Description": "Sweet and savory sauces, relishes, spreads, and seasonings"71        },72        "FirstOrderedOn": new Date(1996, 9, 19)73    },74    {75        "ProductID": 5,76        "ProductName": "Chef Anton's Gumbo Mix",77        "SupplierID": 2,78        "CategoryID": 2,79        "QuantityPerUnit": "36 boxes",80        "UnitPrice": 21.35,81        "UnitsInStock": 0,82        "UnitsOnOrder": 0,83        "ReorderLevel": 0,84        "Discontinued": true,85        "Category": {86            "CategoryID": 2,87            "CategoryName": "Condiments",88            "Description": "Sweet and savory sauces, relishes, spreads, and seasonings"89        },90        "FirstOrderedOn": new Date(1996, 7, 17)91    },92    {93        "ProductID": 6,94        "ProductName": "Grandma's Boysenberry Spread",95        "SupplierID": 3,96        "CategoryID": 2,97        "QuantityPerUnit": "12 - 8 oz jars",98        "UnitPrice": 25,99        "UnitsInStock": 120,100        "UnitsOnOrder": 0,101        "ReorderLevel": 25,102        "Discontinued": false,103        "Category": {104            "CategoryID": 2,105            "CategoryName": "Condiments",106            "Description": "Sweet and savory sauces, relishes, spreads, and seasonings"107        },108        "FirstOrderedOn": new Date(1996, 9, 19)109    },110    {111        "ProductID": 7,112        "ProductName": "Uncle Bob's Organic Dried Pears",113        "SupplierID": 3,114        "CategoryID": 7,115        "QuantityPerUnit": "12 - 1 lb pkgs.",116        "UnitPrice": 30,117        "UnitsInStock": 15,118        "UnitsOnOrder": 0,119        "ReorderLevel": 10,120        "Discontinued": false,121        "Category": {122            "CategoryID": 7,123            "CategoryName": "Produce",124            "Description": "Dried fruit and bean curd"125        },126        "FirstOrderedOn": new Date(1996, 7, 22)127    },128    {129        "ProductID": 8,130        "ProductName": "Northwoods Cranberry Sauce",131        "SupplierID": 3,132        "CategoryID": 2,133        "QuantityPerUnit": "12 - 12 oz jars",134        "UnitPrice": 40,135        "UnitsInStock": 6,136        "UnitsOnOrder": 0,137        "ReorderLevel": 0,138        "Discontinued": false,139        "Category": {140            "CategoryID": 2,141            "CategoryName": "Condiments",142            "Description": "Sweet and savory sauces, relishes, spreads, and seasonings"143        },144        "FirstOrderedOn": new Date(1996, 11, 1)145    },146    {147        "ProductID": 9,148        "ProductName": "Mishi Kobe Niku",149        "SupplierID": 4,150        "CategoryID": 6,151        "QuantityPerUnit": "18 - 500 g pkgs.",152        "UnitPrice": 97,153        "UnitsInStock": 29,154        "UnitsOnOrder": 0,155        "ReorderLevel": 0,156        "Discontinued": true,157        "Category": {158            "CategoryID": 6,159            "CategoryName": "Meat/Poultry",160            "Description": "Prepared meats"161        },162        "FirstOrderedOn": new Date(1997, 1, 21)163    },164    {165        "ProductID": 10,166        "ProductName": "Ikura",167        "SupplierID": 4,168        "CategoryID": 8,169        "QuantityPerUnit": "12 - 200 ml jars",170        "UnitPrice": 31,171        "UnitsInStock": 31,172        "UnitsOnOrder": 0,173        "ReorderLevel": 0,174        "Discontinued": false,175        "Category": {176            "CategoryID": 8,177            "CategoryName": "Seafood",178            "Description": "Seaweed and fish"179        },180        "FirstOrderedOn": new Date(1996, 8, 5)181    }182];183export const products = [{184    "ProductID": 1,185    "ProductName": "Chai",186    "SupplierID": 1,187    "CategoryID": 1,188    "QuantityPerUnit": "10 boxes x 20 bags",189    "UnitPrice": 18.0000,190    "UnitsInStock": 39,191    "UnitsOnOrder": 0,192    "ReorderLevel": 10,193    "Discontinued": false,194    "Category": {195        "CategoryID": 1,196        "CategoryName": "Beverages",197        "Description": "Soft drinks, coffees, teas, beers, and ales"198    }199}, {200    "ProductID": 2,201    "ProductName": "Chang",202    "SupplierID": 1,203    "CategoryID": 1,204    "QuantityPerUnit": "24 - 12 oz bottles",205    "UnitPrice": 19.0000,206    "UnitsInStock": 17,207    "UnitsOnOrder": 40,208    "ReorderLevel": 25,209    "Discontinued": false,210    "Category": {211        "CategoryID": 1,212        "CategoryName": "Beverages",213        "Description": "Soft drinks, coffees, teas, beers, and ales"214    }215}, {216    "ProductID": 3,217    "ProductName": "Aniseed Syrup",218    "SupplierID": 1,219    "CategoryID": 2,220    "QuantityPerUnit": "12 - 550 ml bottles",221    "UnitPrice": 10.0000,222    "UnitsInStock": 13,223    "UnitsOnOrder": 70,224    "ReorderLevel": 25,225    "Discontinued": false,226    "Category": {227        "CategoryID": 2,228        "CategoryName": "Condiments",229        "Description": "Sweet and savory sauces, relishes, spreads, and seasonings"230    }231}, {232    "ProductID": 4,233    "ProductName": "Chef Anton's Cajun Seasoning",234    "SupplierID": 2,235    "CategoryID": 2,236    "QuantityPerUnit": "48 - 6 oz jars",237    "UnitPrice": 22.0000,238    "UnitsInStock": 53,239    "UnitsOnOrder": 0,240    "ReorderLevel": 0,241    "Discontinued": false,242    "Category": {243        "CategoryID": 2,244        "CategoryName": "Condiments",245        "Description": "Sweet and savory sauces, relishes, spreads, and seasonings"246    }247}, {248    "ProductID": 5,249    "ProductName": "Chef Anton's Gumbo Mix",250    "SupplierID": 2,251    "CategoryID": 2,252    "QuantityPerUnit": "36 boxes",253    "UnitPrice": 21.3500,254    "UnitsInStock": 0,255    "UnitsOnOrder": 0,256    "ReorderLevel": 0,257    "Discontinued": true,258    "Category": {259        "CategoryID": 2,260        "CategoryName": "Condiments",261        "Description": "Sweet and savory sauces, relishes, spreads, and seasonings"262    }263}, {264    "ProductID": 6,265    "ProductName": "Grandma's Boysenberry Spread",266    "SupplierID": 3,267    "CategoryID": 2,268    "QuantityPerUnit": "12 - 8 oz jars",269    "UnitPrice": 25.0000,270    "UnitsInStock": 120,271    "UnitsOnOrder": 0,272    "ReorderLevel": 25,273    "Discontinued": false,274    "Category": {275        "CategoryID": 2,276        "CategoryName": "Condiments",277        "Description": "Sweet and savory sauces, relishes, spreads, and seasonings"278    }279}, {280    "ProductID": 7,281    "ProductName": "Uncle Bob's Organic Dried Pears",282    "SupplierID": 3,283    "CategoryID": 7,284    "QuantityPerUnit": "12 - 1 lb pkgs.",285    "UnitPrice": 30.0000,286    "UnitsInStock": 15,287    "UnitsOnOrder": 0,288    "ReorderLevel": 10,289    "Discontinued": false,290    "Category": {291        "CategoryID": 7,292        "CategoryName": "Produce",293        "Description": "Dried fruit and bean curd"294    }295}, {296    "ProductID": 8,297    "ProductName": "Northwoods Cranberry Sauce",298    "SupplierID": 3,299    "CategoryID": 2,300    "QuantityPerUnit": "12 - 12 oz jars",301    "UnitPrice": 40.0000,302    "UnitsInStock": 6,303    "UnitsOnOrder": 0,304    "ReorderLevel": 0,305    "Discontinued": false,306    "Category": {307        "CategoryID": 2,308        "CategoryName": "Condiments",309        "Description": "Sweet and savory sauces, relishes, spreads, and seasonings"310    }311}, {312    "ProductID": 9,313    "ProductName": "Mishi Kobe Niku",314    "SupplierID": 4,315    "CategoryID": 6,316    "QuantityPerUnit": "18 - 500 g pkgs.",317    "UnitPrice": 97.0000,318    "UnitsInStock": 29,319    "UnitsOnOrder": 0,320    "ReorderLevel": 0,321    "Discontinued": true,322    "Category": {323        "CategoryID": 6,324        "CategoryName": "Meat/Poultry",325        "Description": "Prepared meats"326    }327}, {328    "ProductID": 10,329    "ProductName": "Ikura",330    "SupplierID": 4,331    "CategoryID": 8,332    "QuantityPerUnit": "12 - 200 ml jars",333    "UnitPrice": 31.0000,334    "UnitsInStock": 31,335    "UnitsOnOrder": 0,336    "ReorderLevel": 0,337    "Discontinued": false,338    "Category": {339        "CategoryID": 8,340        "CategoryName": "Seafood",341        "Description": "Seaweed and fish"342    }343}, {344    "ProductID": 11,345    "ProductName": "Queso Cabrales",346    "SupplierID": 5,347    "CategoryID": 4,348    "QuantityPerUnit": "1 kg pkg.",349    "UnitPrice": 21.0000,350    "UnitsInStock": 22,351    "UnitsOnOrder": 30,352    "ReorderLevel": 30,353    "Discontinued": false,354    "Category": {355        "CategoryID": 4,356        "CategoryName": "Dairy Products",357        "Description": "Cheeses"358    }359}, {360    "ProductID": 12,361    "ProductName": "Queso Manchego La Pastora",362    "SupplierID": 5,363    "CategoryID": 4,364    "QuantityPerUnit": "10 - 500 g pkgs.",365    "UnitPrice": 38.0000,366    "UnitsInStock": 86,367    "UnitsOnOrder": 0,368    "ReorderLevel": 0,369    "Discontinued": false,370    "Category": {371        "CategoryID": 4,372        "CategoryName": "Dairy Products",373        "Description": "Cheeses"374    }375}, {376    "ProductID": 13,377    "ProductName": "Konbu",378    "SupplierID": 6,379    "CategoryID": 8,380    "QuantityPerUnit": "2 kg box",381    "UnitPrice": 6.0000,382    "UnitsInStock": 24,383    "UnitsOnOrder": 0,384    "ReorderLevel": 5,385    "Discontinued": false,386    "Category": {387        "CategoryID": 8,388        "CategoryName": "Seafood",389        "Description": "Seaweed and fish"390    }391}, {392    "ProductID": 14,393    "ProductName": "Tofu",394    "SupplierID": 6,395    "CategoryID": 7,396    "QuantityPerUnit": "40 - 100 g pkgs.",397    "UnitPrice": 23.2500,398    "UnitsInStock": 35,399    "UnitsOnOrder": 0,400    "ReorderLevel": 0,401    "Discontinued": false,402    "Category": {403        "CategoryID": 7,404        "CategoryName": "Produce",405        "Description": "Dried fruit and bean curd"406    }407}, {408    "ProductID": 15,409    "ProductName": "Genen Shouyu",410    "SupplierID": 6,411    "CategoryID": 2,412    "QuantityPerUnit": "24 - 250 ml bottles",413    "UnitPrice": 15.5000,414    "UnitsInStock": 39,415    "UnitsOnOrder": 0,416    "ReorderLevel": 5,417    "Discontinued": false,418    "Category": {419        "CategoryID": 2,420        "CategoryName": "Condiments",421        "Description": "Sweet and savory sauces, relishes, spreads, and seasonings"422    }423}, {424    "ProductID": 16,425    "ProductName": "Pavlova",426    "SupplierID": 7,427    "CategoryID": 3,428    "QuantityPerUnit": "32 - 500 g boxes",429    "UnitPrice": 17.4500,430    "UnitsInStock": 29,431    "UnitsOnOrder": 0,432    "ReorderLevel": 10,433    "Discontinued": false,434    "Category": {435        "CategoryID": 3,436        "CategoryName": "Confections",437        "Description": "Desserts, candies, and sweet breads"438    }439}, {440    "ProductID": 17,441    "ProductName": "Alice Mutton",442    "SupplierID": 7,443    "CategoryID": 6,444    "QuantityPerUnit": "20 - 1 kg tins",445    "UnitPrice": 39.0000,446    "UnitsInStock": 0,447    "UnitsOnOrder": 0,448    "ReorderLevel": 0,449    "Discontinued": true,450    "Category": {451        "CategoryID": 6,452        "CategoryName": "Meat/Poultry",453        "Description": "Prepared meats"454    }455}, {456    "ProductID": 18,457    "ProductName": "Carnarvon Tigers",458    "SupplierID": 7,459    "CategoryID": 8,460    "QuantityPerUnit": "16 kg pkg.",461    "UnitPrice": 62.5000,462    "UnitsInStock": 42,463    "UnitsOnOrder": 0,464    "ReorderLevel": 0,465    "Discontinued": false,466    "Category": {467        "CategoryID": 8,468        "CategoryName": "Seafood",469        "Description": "Seaweed and fish"470    }471}, {472    "ProductID": 19,473    "ProductName": "Teatime Chocolate Biscuits",474    "SupplierID": 8,475    "CategoryID": 3,476    "QuantityPerUnit": "10 boxes x 12 pieces",477    "UnitPrice": 9.2000,478    "UnitsInStock": 25,479    "UnitsOnOrder": 0,480    "ReorderLevel": 5,481    "Discontinued": false,482    "Category": {483        "CategoryID": 3,484        "CategoryName": "Confections",485        "Description": "Desserts, candies, and sweet breads"486    }487}, {488    "ProductID": 20,489    "ProductName": "Sir Rodney's Marmalade",490    "SupplierID": 8,491    "CategoryID": 3,492    "QuantityPerUnit": "30 gift boxes",493    "UnitPrice": 81.0000,494    "UnitsInStock": 40,495    "UnitsOnOrder": 0,496    "ReorderLevel": 0,497    "Discontinued": false,498    "Category": {499        "CategoryID": 3,500        "CategoryName": "Confections",501        "Description": "Desserts, candies, and sweet breads"502    }503}, {504    "ProductID": 21,505    "ProductName": "Sir Rodney's Scones",506    "SupplierID": 8,507    "CategoryID": 3,508    "QuantityPerUnit": "24 pkgs. x 4 pieces",509    "UnitPrice": 10.0000,510    "UnitsInStock": 3,511    "UnitsOnOrder": 40,512    "ReorderLevel": 5,513    "Discontinued": false,514    "Category": {515        "CategoryID": 3,516        "CategoryName": "Confections",517        "Description": "Desserts, candies, and sweet breads"518    }519}, {520    "ProductID": 22,521    "ProductName": "Gustaf's Knäckebröd",522    "SupplierID": 9,523    "CategoryID": 5,524    "QuantityPerUnit": "24 - 500 g pkgs.",525    "UnitPrice": 21.0000,526    "UnitsInStock": 104,527    "UnitsOnOrder": 0,528    "ReorderLevel": 25,529    "Discontinued": false,530    "Category": {531        "CategoryID": 5,532        "CategoryName": "Grains/Cereals",533        "Description": "Breads, crackers, pasta, and cereal"534    }535}, {536    "ProductID": 23,537    "ProductName": "Tunnbröd",538    "SupplierID": 9,539    "CategoryID": 5,540    "QuantityPerUnit": "12 - 250 g pkgs.",541    "UnitPrice": 9.0000,542    "UnitsInStock": 61,543    "UnitsOnOrder": 0,544    "ReorderLevel": 25,545    "Discontinued": false,546    "Category": {547        "CategoryID": 5,548        "CategoryName": "Grains/Cereals",549        "Description": "Breads, crackers, pasta, and cereal"550    }551}, {552    "ProductID": 24,553    "ProductName": "Guaraná Fantástica",554    "SupplierID": 10,555    "CategoryID": 1,556    "QuantityPerUnit": "12 - 355 ml cans",557    "UnitPrice": 4.5000,558    "UnitsInStock": 20,559    "UnitsOnOrder": 0,560    "ReorderLevel": 0,561    "Discontinued": true,562    "Category": {563        "CategoryID": 1,564        "CategoryName": "Beverages",565        "Description": "Soft drinks, coffees, teas, beers, and ales"566    }567}, {568    "ProductID": 25,569    "ProductName": "NuNuCa NuÃ-Nougat-Creme",570    "SupplierID": 11,571    "CategoryID": 3,572    "QuantityPerUnit": "20 - 450 g glasses",573    "UnitPrice": 14.0000,574    "UnitsInStock": 76,575    "UnitsOnOrder": 0,576    "ReorderLevel": 30,577    "Discontinued": false,578    "Category": {579        "CategoryID": 3,580        "CategoryName": "Confections",581        "Description": "Desserts, candies, and sweet breads"582    }583}, {584    "ProductID": 26,585    "ProductName": "Gumbär Gummibärchen",586    "SupplierID": 11,587    "CategoryID": 3,588    "QuantityPerUnit": "100 - 250 g bags",589    "UnitPrice": 31.2300,590    "UnitsInStock": 15,591    "UnitsOnOrder": 0,592    "ReorderLevel": 0,593    "Discontinued": false,594    "Category": {595        "CategoryID": 3,596        "CategoryName": "Confections",597        "Description": "Desserts, candies, and sweet breads"598    }599}, {600    "ProductID": 27,601    "ProductName": "Schoggi Schokolade",602    "SupplierID": 11,603    "CategoryID": 3,604    "QuantityPerUnit": "100 - 100 g pieces",605    "UnitPrice": 43.9000,606    "UnitsInStock": 49,607    "UnitsOnOrder": 0,608    "ReorderLevel": 30,609    "Discontinued": false,610    "Category": {611        "CategoryID": 3,612        "CategoryName": "Confections",613        "Description": "Desserts, candies, and sweet breads"614    }615}, {616    "ProductID": 28,617    "ProductName": "Rössle Sauerkraut",618    "SupplierID": 12,619    "CategoryID": 7,620    "QuantityPerUnit": "25 - 825 g cans",621    "UnitPrice": 45.6000,622    "UnitsInStock": 26,623    "UnitsOnOrder": 0,624    "ReorderLevel": 0,625    "Discontinued": true,626    "Category": {627        "CategoryID": 7,628        "CategoryName": "Produce",629        "Description": "Dried fruit and bean curd"630    }631}, {632    "ProductID": 29,633    "ProductName": "Thüringer Rostbratwurst",634    "SupplierID": 12,635    "CategoryID": 6,636    "QuantityPerUnit": "50 bags x 30 sausgs.",637    "UnitPrice": 123.7900,638    "UnitsInStock": 0,639    "UnitsOnOrder": 0,640    "ReorderLevel": 0,641    "Discontinued": true,642    "Category": {643        "CategoryID": 6,644        "CategoryName": "Meat/Poultry",645        "Description": "Prepared meats"646    }647}, {648    "ProductID": 30,649    "ProductName": "Nord-Ost Matjeshering",650    "SupplierID": 13,651    "CategoryID": 8,652    "QuantityPerUnit": "10 - 200 g glasses",653    "UnitPrice": 25.8900,654    "UnitsInStock": 10,655    "UnitsOnOrder": 0,656    "ReorderLevel": 15,657    "Discontinued": false,658    "Category": {659        "CategoryID": 8,660        "CategoryName": "Seafood",661        "Description": "Seaweed and fish"662    }663}, {664    "ProductID": 31,665    "ProductName": "Gorgonzola Telino",666    "SupplierID": 14,667    "CategoryID": 4,668    "QuantityPerUnit": "12 - 100 g pkgs",669    "UnitPrice": 12.5000,670    "UnitsInStock": 0,671    "UnitsOnOrder": 70,672    "ReorderLevel": 20,673    "Discontinued": false,674    "Category": {675        "CategoryID": 4,676        "CategoryName": "Dairy Products",677        "Description": "Cheeses"678    }679}, {680    "ProductID": 32,681    "ProductName": "Mascarpone Fabioli",682    "SupplierID": 14,683    "CategoryID": 4,684    "QuantityPerUnit": "24 - 200 g pkgs.",685    "UnitPrice": 32.0000,686    "UnitsInStock": 9,687    "UnitsOnOrder": 40,688    "ReorderLevel": 25,689    "Discontinued": false,690    "Category": {691        "CategoryID": 4,692        "CategoryName": "Dairy Products",693        "Description": "Cheeses"694    }695}, {696    "ProductID": 33,697    "ProductName": "Geitost",698    "SupplierID": 15,699    "CategoryID": 4,700    "QuantityPerUnit": "500 g",701    "UnitPrice": 2.5000,702    "UnitsInStock": 112,703    "UnitsOnOrder": 0,704    "ReorderLevel": 20,705    "Discontinued": false,706    "Category": {707        "CategoryID": 4,708        "CategoryName": "Dairy Products",709        "Description": "Cheeses"710    }711}, {712    "ProductID": 34,713    "ProductName": "Sasquatch Ale",714    "SupplierID": 16,715    "CategoryID": 1,716    "QuantityPerUnit": "24 - 12 oz bottles",717    "UnitPrice": 14.0000,718    "UnitsInStock": 111,719    "UnitsOnOrder": 0,720    "ReorderLevel": 15,721    "Discontinued": false,722    "Category": {723        "CategoryID": 1,724        "CategoryName": "Beverages",725        "Description": "Soft drinks, coffees, teas, beers, and ales"726    }727}, {728    "ProductID": 35,729    "ProductName": "Steeleye Stout",730    "SupplierID": 16,731    "CategoryID": 1,732    "QuantityPerUnit": "24 - 12 oz bottles",733    "UnitPrice": 18.0000,734    "UnitsInStock": 20,735    "UnitsOnOrder": 0,736    "ReorderLevel": 15,737    "Discontinued": false,738    "Category": {739        "CategoryID": 1,740        "CategoryName": "Beverages",741        "Description": "Soft drinks, coffees, teas, beers, and ales"742    }743}, {744    "ProductID": 36,745    "ProductName": "Inlagd Sill",746    "SupplierID": 17,747    "CategoryID": 8,748    "QuantityPerUnit": "24 - 250 g  jars",749    "UnitPrice": 19.0000,750    "UnitsInStock": 112,751    "UnitsOnOrder": 0,752    "ReorderLevel": 20,753    "Discontinued": false,754    "Category": {755        "CategoryID": 8,756        "CategoryName": "Seafood",757        "Description": "Seaweed and fish"758    }759}, {760    "ProductID": 37,761    "ProductName": "Gravad lax",762    "SupplierID": 17,763    "CategoryID": 8,764    "QuantityPerUnit": "12 - 500 g pkgs.",765    "UnitPrice": 26.0000,766    "UnitsInStock": 11,767    "UnitsOnOrder": 50,768    "ReorderLevel": 25,769    "Discontinued": false,770    "Category": {771        "CategoryID": 8,772        "CategoryName": "Seafood",773        "Description": "Seaweed and fish"774    }775}, {776    "ProductID": 38,777    "ProductName": "Côte de Blaye",778    "SupplierID": 18,779    "CategoryID": 1,780    "QuantityPerUnit": "12 - 75 cl bottles",781    "UnitPrice": 263.5000,782    "UnitsInStock": 17,783    "UnitsOnOrder": 0,784    "ReorderLevel": 15,785    "Discontinued": false,786    "Category": {787        "CategoryID": 1,788        "CategoryName": "Beverages",789        "Description": "Soft drinks, coffees, teas, beers, and ales"790    }791}, {792    "ProductID": 39,793    "ProductName": "Chartreuse verte",794    "SupplierID": 18,795    "CategoryID": 1,796    "QuantityPerUnit": "750 cc per bottle",797    "UnitPrice": 18.0000,798    "UnitsInStock": 69,799    "UnitsOnOrder": 0,800    "ReorderLevel": 5,801    "Discontinued": false,802    "Category": {803        "CategoryID": 1,804        "CategoryName": "Beverages",805        "Description": "Soft drinks, coffees, teas, beers, and ales"806    }807}, {808    "ProductID": 40,809    "ProductName": "Boston Crab Meat",810    "SupplierID": 19,811    "CategoryID": 8,812    "QuantityPerUnit": "24 - 4 oz tins",813    "UnitPrice": 18.4000,814    "UnitsInStock": 123,815    "UnitsOnOrder": 0,816    "ReorderLevel": 30,817    "Discontinued": false,818    "Category": {819        "CategoryID": 8,820        "CategoryName": "Seafood",821        "Description": "Seaweed and fish"822    }823}, {824    "ProductID": 41,825    "ProductName": "Jack's New England Clam Chowder",826    "SupplierID": 19,827    "CategoryID": 8,828    "QuantityPerUnit": "12 - 12 oz cans",829    "UnitPrice": 9.6500,830    "UnitsInStock": 85,831    "UnitsOnOrder": 0,832    "ReorderLevel": 10,833    "Discontinued": false,834    "Category": {835        "CategoryID": 8,836        "CategoryName": "Seafood",837        "Description": "Seaweed and fish"838    }839}, {840    "ProductID": 42,841    "ProductName": "Singaporean Hokkien Fried Mee",842    "SupplierID": 20,843    "CategoryID": 5,844    "QuantityPerUnit": "32 - 1 kg pkgs.",845    "UnitPrice": 14.0000,846    "UnitsInStock": 26,847    "UnitsOnOrder": 0,848    "ReorderLevel": 0,849    "Discontinued": true,850    "Category": {851        "CategoryID": 5,852        "CategoryName": "Grains/Cereals",853        "Description": "Breads, crackers, pasta, and cereal"854    }855}, {856    "ProductID": 43,857    "ProductName": "Ipoh Coffee",858    "SupplierID": 20,859    "CategoryID": 1,860    "QuantityPerUnit": "16 - 500 g tins",861    "UnitPrice": 46.0000,862    "UnitsInStock": 17,863    "UnitsOnOrder": 10,864    "ReorderLevel": 25,865    "Discontinued": false,866    "Category": {867        "CategoryID": 1,868        "CategoryName": "Beverages",869        "Description": "Soft drinks, coffees, teas, beers, and ales"870    }871}, {872    "ProductID": 44,873    "ProductName": "Gula Malacca",874    "SupplierID": 20,875    "CategoryID": 2,876    "QuantityPerUnit": "20 - 2 kg bags",877    "UnitPrice": 19.4500,878    "UnitsInStock": 27,879    "UnitsOnOrder": 0,880    "ReorderLevel": 15,881    "Discontinued": false,882    "Category": {883        "CategoryID": 2,884        "CategoryName": "Condiments",885        "Description": "Sweet and savory sauces, relishes, spreads, and seasonings"886    }887}, {888    "ProductID": 45,889    "ProductName": "Rogede sild",890    "SupplierID": 21,891    "CategoryID": 8,892    "QuantityPerUnit": "1k pkg.",893    "UnitPrice": 9.5000,894    "UnitsInStock": 5,895    "UnitsOnOrder": 70,896    "ReorderLevel": 15,897    "Discontinued": false,898    "Category": {899        "CategoryID": 8,900        "CategoryName": "Seafood",901        "Description": "Seaweed and fish"902    }903}, {904    "ProductID": 46,905    "ProductName": "Spegesild",906    "SupplierID": 21,907    "CategoryID": 8,908    "QuantityPerUnit": "4 - 450 g glasses",909    "UnitPrice": 12.0000,910    "UnitsInStock": 95,911    "UnitsOnOrder": 0,912    "ReorderLevel": 0,913    "Discontinued": false,914    "Category": {915        "CategoryID": 8,916        "CategoryName": "Seafood",917        "Description": "Seaweed and fish"918    }919}, {920    "ProductID": 47,921    "ProductName": "Zaanse koeken",922    "SupplierID": 22,923    "CategoryID": 3,924    "QuantityPerUnit": "10 - 4 oz boxes",925    "UnitPrice": 9.5000,926    "UnitsInStock": 36,927    "UnitsOnOrder": 0,928    "ReorderLevel": 0,929    "Discontinued": false,930    "Category": {931        "CategoryID": 3,932        "CategoryName": "Confections",933        "Description": "Desserts, candies, and sweet breads"934    }935}, {936    "ProductID": 48,937    "ProductName": "Chocolade",938    "SupplierID": 22,939    "CategoryID": 3,940    "QuantityPerUnit": "10 pkgs.",941    "UnitPrice": 12.7500,942    "UnitsInStock": 15,943    "UnitsOnOrder": 70,944    "ReorderLevel": 25,945    "Discontinued": false,946    "Category": {947        "CategoryID": 3,948        "CategoryName": "Confections",949        "Description": "Desserts, candies, and sweet breads"950    }951}, {952    "ProductID": 49,953    "ProductName": "Maxilaku",954    "SupplierID": 23,955    "CategoryID": 3,956    "QuantityPerUnit": "24 - 50 g pkgs.",957    "UnitPrice": 20.0000,958    "UnitsInStock": 10,959    "UnitsOnOrder": 60,960    "ReorderLevel": 15,961    "Discontinued": false,962    "Category": {963        "CategoryID": 3,964        "CategoryName": "Confections",965        "Description": "Desserts, candies, and sweet breads"966    }967}, {968    "ProductID": 50,969    "ProductName": "Valkoinen suklaa",970    "SupplierID": 23,971    "CategoryID": 3,972    "QuantityPerUnit": "12 - 100 g bars",973    "UnitPrice": 16.2500,974    "UnitsInStock": 65,975    "UnitsOnOrder": 0,976    "ReorderLevel": 30,977    "Discontinued": false,978    "Category": {979        "CategoryID": 3,980        "CategoryName": "Confections",981        "Description": "Desserts, candies, and sweet breads"982    }983}, {984    "ProductID": 51,985    "ProductName": "Manjimup Dried Apples",986    "SupplierID": 24,987    "CategoryID": 7,988    "QuantityPerUnit": "50 - 300 g pkgs.",989    "UnitPrice": 53.0000,990    "UnitsInStock": 20,991    "UnitsOnOrder": 0,992    "ReorderLevel": 10,993    "Discontinued": false,994    "Category": {995        "CategoryID": 7,996        "CategoryName": "Produce",997        "Description": "Dried fruit and bean curd"998    }999}, {1000    "ProductID": 52,1001    "ProductName": "Filo Mix",1002    "SupplierID": 24,1003    "CategoryID": 5,1004    "QuantityPerUnit": "16 - 2 kg boxes",1005    "UnitPrice": 7.0000,1006    "UnitsInStock": 38,1007    "UnitsOnOrder": 0,1008    "ReorderLevel": 25,1009    "Discontinued": false,1010    "Category": {1011        "CategoryID": 5,1012        "CategoryName": "Grains/Cereals",1013        "Description": "Breads, crackers, pasta, and cereal"1014    }1015}, {1016    "ProductID": 53,1017    "ProductName": "Perth Pasties",1018    "SupplierID": 24,1019    "CategoryID": 6,1020    "QuantityPerUnit": "48 pieces",1021    "UnitPrice": 32.8000,1022    "UnitsInStock": 0,1023    "UnitsOnOrder": 0,1024    "ReorderLevel": 0,1025    "Discontinued": true,1026    "Category": {1027        "CategoryID": 6,1028        "CategoryName": "Meat/Poultry",1029        "Description": "Prepared meats"1030    }1031}, {1032    "ProductID": 54,1033    "ProductName": "Tourtière",1034    "SupplierID": 25,1035    "CategoryID": 6,1036    "QuantityPerUnit": "16 pies",1037    "UnitPrice": 7.4500,1038    "UnitsInStock": 21,1039    "UnitsOnOrder": 0,1040    "ReorderLevel": 10,1041    "Discontinued": false,1042    "Category": {1043        "CategoryID": 6,1044        "CategoryName": "Meat/Poultry",1045        "Description": "Prepared meats"1046    }1047}, {1048    "ProductID": 55,1049    "ProductName": "Pâté chinois",1050    "SupplierID": 25,1051    "CategoryID": 6,1052    "QuantityPerUnit": "24 boxes x 2 pies",1053    "UnitPrice": 24.0000,1054    "UnitsInStock": 115,1055    "UnitsOnOrder": 0,1056    "ReorderLevel": 20,1057    "Discontinued": false,1058    "Category": {1059        "CategoryID": 6,1060        "CategoryName": "Meat/Poultry",1061        "Description": "Prepared meats"1062    }1063}, {1064    "ProductID": 56,1065    "ProductName": "Gnocchi di nonna Alice",1066    "SupplierID": 26,1067    "CategoryID": 5,1068    "QuantityPerUnit": "24 - 250 g pkgs.",1069    "UnitPrice": 38.0000,1070    "UnitsInStock": 21,1071    "UnitsOnOrder": 10,1072    "ReorderLevel": 30,1073    "Discontinued": false,1074    "Category": {1075        "CategoryID": 5,1076        "CategoryName": "Grains/Cereals",1077        "Description": "Breads, crackers, pasta, and cereal"1078    }1079}, {1080    "ProductID": 57,1081    "ProductName": "Ravioli Angelo",1082    "SupplierID": 26,1083    "CategoryID": 5,1084    "QuantityPerUnit": "24 - 250 g pkgs.",1085    "UnitPrice": 19.5000,1086    "UnitsInStock": 36,1087    "UnitsOnOrder": 0,1088    "ReorderLevel": 20,1089    "Discontinued": false,1090    "Category": {1091        "CategoryID": 5,1092        "CategoryName": "Grains/Cereals",1093        "Description": "Breads, crackers, pasta, and cereal"1094    }1095}, {1096    "ProductID": 58,1097    "ProductName": "Escargots de Bourgogne",1098    "SupplierID": 27,1099    "CategoryID": 8,1100    "QuantityPerUnit": "24 pieces",1101    "UnitPrice": 13.2500,1102    "UnitsInStock": 62,1103    "UnitsOnOrder": 0,1104    "ReorderLevel": 20,1105    "Discontinued": false,1106    "Category": {1107        "CategoryID": 8,1108        "CategoryName": "Seafood",1109        "Description": "Seaweed and fish"1110    }1111}, {1112    "ProductID": 59,1113    "ProductName": "Raclette Courdavault",1114    "SupplierID": 28,1115    "CategoryID": 4,1116    "QuantityPerUnit": "5 kg pkg.",1117    "UnitPrice": 55.0000,1118    "UnitsInStock": 79,1119    "UnitsOnOrder": 0,1120    "ReorderLevel": 0,1121    "Discontinued": false,1122    "Category": {1123        "CategoryID": 4,1124        "CategoryName": "Dairy Products",1125        "Description": "Cheeses"1126    }1127}, {1128    "ProductID": 60,1129    "ProductName": "Camembert Pierrot",1130    "SupplierID": 28,1131    "CategoryID": 4,1132    "QuantityPerUnit": "15 - 300 g rounds",1133    "UnitPrice": 34.0000,1134    "UnitsInStock": 19,1135    "UnitsOnOrder": 0,1136    "ReorderLevel": 0,1137    "Discontinued": false,1138    "Category": {1139        "CategoryID": 4,1140        "CategoryName": "Dairy Products",1141        "Description": "Cheeses"1142    }1143}, {1144    "ProductID": 61,1145    "ProductName": "Sirop d'érable",1146    "SupplierID": 29,1147    "CategoryID": 2,1148    "QuantityPerUnit": "24 - 500 ml bottles",1149    "UnitPrice": 28.5000,1150    "UnitsInStock": 113,1151    "UnitsOnOrder": 0,1152    "ReorderLevel": 25,1153    "Discontinued": false,1154    "Category": {1155        "CategoryID": 2,1156        "CategoryName": "Condiments",1157        "Description": "Sweet and savory sauces, relishes, spreads, and seasonings"1158    }1159}, {1160    "ProductID": 62,1161    "ProductName": "Tarte au sucre",1162    "SupplierID": 29,1163    "CategoryID": 3,1164    "QuantityPerUnit": "48 pies",1165    "UnitPrice": 49.3000,1166    "UnitsInStock": 17,1167    "UnitsOnOrder": 0,1168    "ReorderLevel": 0,1169    "Discontinued": false,1170    "Category": {1171        "CategoryID": 3,1172        "CategoryName": "Confections",1173        "Description": "Desserts, candies, and sweet breads"1174    }1175}, {1176    "ProductID": 63,1177    "ProductName": "Vegie-spread",1178    "SupplierID": 7,1179    "CategoryID": 2,1180    "QuantityPerUnit": "15 - 625 g jars",1181    "UnitPrice": 43.9000,1182    "UnitsInStock": 24,1183    "UnitsOnOrder": 0,1184    "ReorderLevel": 5,1185    "Discontinued": false,1186    "Category": {1187        "CategoryID": 2,1188        "CategoryName": "Condiments",1189        "Description": "Sweet and savory sauces, relishes, spreads, and seasonings"1190    }1191}, {1192    "ProductID": 64,1193    "ProductName": "Wimmers gute Semmelknödel",1194    "SupplierID": 12,1195    "CategoryID": 5,1196    "QuantityPerUnit": "20 bags x 4 pieces",1197    "UnitPrice": 33.2500,1198    "UnitsInStock": 22,1199    "UnitsOnOrder": 80,1200    "ReorderLevel": 30,1201    "Discontinued": false,1202    "Category": {1203        "CategoryID": 5,1204        "CategoryName": "Grains/Cereals",1205        "Description": "Breads, crackers, pasta, and cereal"1206    }1207}, {1208    "ProductID": 65,1209    "ProductName": "Louisiana Fiery Hot Pepper Sauce",1210    "SupplierID": 2,1211    "CategoryID": 2,1212    "QuantityPerUnit": "32 - 8 oz bottles",1213    "UnitPrice": 21.0500,1214    "UnitsInStock": 76,1215    "UnitsOnOrder": 0,1216    "ReorderLevel": 0,1217    "Discontinued": false,1218    "Category": {1219        "CategoryID": 2,1220        "CategoryName": "Condiments",1221        "Description": "Sweet and savory sauces, relishes, spreads, and seasonings"1222    }1223}, {1224    "ProductID": 66,1225    "ProductName": "Louisiana Hot Spiced Okra",1226    "SupplierID": 2,1227    "CategoryID": 2,1228    "QuantityPerUnit": "24 - 8 oz jars",1229    "UnitPrice": 17.0000,1230    "UnitsInStock": 4,1231    "UnitsOnOrder": 100,1232    "ReorderLevel": 20,1233    "Discontinued": false,1234    "Category": {1235        "CategoryID": 2,1236        "CategoryName": "Condiments",1237        "Description": "Sweet and savory sauces, relishes, spreads, and seasonings"1238    }1239}, {1240    "ProductID": 67,1241    "ProductName": "Laughing Lumberjack Lager",1242    "SupplierID": 16,1243    "CategoryID": 1,1244    "QuantityPerUnit": "24 - 12 oz bottles",1245    "UnitPrice": 14.0000,1246    "UnitsInStock": 52,1247    "UnitsOnOrder": 0,1248    "ReorderLevel": 10,1249    "Discontinued": false,1250    "Category": {1251        "CategoryID": 1,1252        "CategoryName": "Beverages",1253        "Description": "Soft drinks, coffees, teas, beers, and ales"1254    }1255}, {1256    "ProductID": 68,1257    "ProductName": "Scottish Longbreads",1258    "SupplierID": 8,1259    "CategoryID": 3,1260    "QuantityPerUnit": "10 boxes x 8 pieces",1261    "UnitPrice": 12.5000,1262    "UnitsInStock": 6,1263    "UnitsOnOrder": 10,1264    "ReorderLevel": 15,1265    "Discontinued": false,1266    "Category": {1267        "CategoryID": 3,1268        "CategoryName": "Confections",1269        "Description": "Desserts, candies, and sweet breads"1270    }1271}, {1272    "ProductID": 69,1273    "ProductName": "Gudbrandsdalsost",1274    "SupplierID": 15,1275    "CategoryID": 4,1276    "QuantityPerUnit": "10 kg pkg.",1277    "UnitPrice": 36.0000,1278    "UnitsInStock": 26,1279    "UnitsOnOrder": 0,1280    "ReorderLevel": 15,1281    "Discontinued": false,1282    "Category": {1283        "CategoryID": 4,1284        "CategoryName": "Dairy Products",1285        "Description": "Cheeses"1286    }1287}, {1288    "ProductID": 70,1289    "ProductName": "Outback Lager",1290    "SupplierID": 7,1291    "CategoryID": 1,1292    "QuantityPerUnit": "24 - 355 ml bottles",1293    "UnitPrice": 15.0000,1294    "UnitsInStock": 15,1295    "UnitsOnOrder": 10,1296    "ReorderLevel": 30,1297    "Discontinued": false,1298    "Category": {1299        "CategoryID": 1,1300        "CategoryName": "Beverages",1301        "Description": "Soft drinks, coffees, teas, beers, and ales"1302    }1303}, {1304    "ProductID": 71,1305    "ProductName": "Flotemysost",1306    "SupplierID": 15,1307    "CategoryID": 4,1308    "QuantityPerUnit": "10 - 500 g pkgs.",1309    "UnitPrice": 21.5000,1310    "UnitsInStock": 26,1311    "UnitsOnOrder": 0,1312    "ReorderLevel": 0,1313    "Discontinued": false,1314    "Category": {1315        "CategoryID": 4,1316        "CategoryName": "Dairy Products",1317        "Description": "Cheeses"1318    }1319}, {1320    "ProductID": 72,1321    "ProductName": "Mozzarella di Giovanni",1322    "SupplierID": 14,1323    "CategoryID": 4,1324    "QuantityPerUnit": "24 - 200 g pkgs.",1325    "UnitPrice": 34.8000,1326    "UnitsInStock": 14,1327    "UnitsOnOrder": 0,1328    "ReorderLevel": 0,1329    "Discontinued": false,1330    "Category": {1331        "CategoryID": 4,1332        "CategoryName": "Dairy Products",1333        "Description": "Cheeses"1334    }1335}, {1336    "ProductID": 73,1337    "ProductName": "Röd Kaviar",1338    "SupplierID": 17,1339    "CategoryID": 8,1340    "QuantityPerUnit": "24 - 150 g jars",1341    "UnitPrice": 15.0000,1342    "UnitsInStock": 101,1343    "UnitsOnOrder": 0,1344    "ReorderLevel": 5,1345    "Discontinued": false,1346    "Category": {1347        "CategoryID": 8,1348        "CategoryName": "Seafood",1349        "Description": "Seaweed and fish"1350    }1351}, {1352    "ProductID": 74,1353    "ProductName": "Longlife Tofu",1354    "SupplierID": 4,1355    "CategoryID": 7,1356    "QuantityPerUnit": "5 kg pkg.",1357    "UnitPrice": 10.0000,1358    "UnitsInStock": 4,1359    "UnitsOnOrder": 20,1360    "ReorderLevel": 5,1361    "Discontinued": false,1362    "Category": {1363        "CategoryID": 7,1364        "CategoryName": "Produce",1365        "Description": "Dried fruit and bean curd"1366    }1367}, {1368    "ProductID": 75,1369    "ProductName": "Rhönbräu Klosterbier",1370    "SupplierID": 12,1371    "CategoryID": 1,1372    "QuantityPerUnit": "24 - 0.5 l bottles",1373    "UnitPrice": 7.7500,1374    "UnitsInStock": 125,1375    "UnitsOnOrder": 0,1376    "ReorderLevel": 25,1377    "Discontinued": false,1378    "Category": {1379        "CategoryID": 1,1380        "CategoryName": "Beverages",1381        "Description": "Soft drinks, coffees, teas, beers, and ales"1382    }1383}, {1384    "ProductID": 76,1385    "ProductName": "Lakkalikööri",1386    "SupplierID": 23,1387    "CategoryID": 1,1388    "QuantityPerUnit": "500 ml",1389    "UnitPrice": 18.0000,1390    "UnitsInStock": 57,1391    "UnitsOnOrder": 0,1392    "ReorderLevel": 20,1393    "Discontinued": false,1394    "Category": {1395        "CategoryID": 1,1396        "CategoryName": "Beverages",1397        "Description": "Soft drinks, coffees, teas, beers, and ales"1398    }1399}, {1400    "ProductID": 77,1401    "ProductName": "Original Frankfurter grüne SoÃe",1402    "SupplierID": 12,1403    "CategoryID": 2,1404    "QuantityPerUnit": "12 boxes",1405    "UnitPrice": 13.0000,1406    "UnitsInStock": 32,1407    "UnitsOnOrder": 0,1408    "ReorderLevel": 15,1409    "Discontinued": false,1410    "Category": {1411        "CategoryID": 2,1412        "CategoryName": "Condiments",1413        "Description": "Sweet and savory sauces, relishes, spreads, and seasonings"1414    }...JDK-8078049.js
Source:JDK-8078049.js  
1/*2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.4 * 5 * This code is free software; you can redistribute it and/or modify it6 * under the terms of the GNU General Public License version 2 only, as7 * published by the Free Software Foundation.8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License12 * version 2 for more details (a copy is included in the LICENSE file that13 * accompanied this code).14 * 15 * You should have received a copy of the GNU General Public License version16 * 2 along with this work; if not, write to the Free Software Foundation,17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20 * or visit www.oracle.com if you need additional information or have any21 * questions.22 */23/**24 * JDK-8078049: Nashorn crashes when attempting to start the new tsc.js compiler for TypeScript25 *26 * @test27 * @run28 * @fork29 * @option -Dnashorn.debug=true30 */31var m = 1;32var fields = {33    p0: { code: 0, category: m },34    p1: { code: 1, category: m },35    p2: { code: 2, category: m }36};37var spill = {38    p0: { code: 0, category: m },39    p1: { code: 1, category: m },40    p2: { code: 2, category: m },41    p3: { code: 3, category: m },42    p4: { code: 4, category: m },43    p5: { code: 5, category: m },44    p6: { code: 6, category: m },45    p7: { code: 7, category: m },46    p8: { code: 8, category: m },47    p9: { code: 9, category: m },48    p10: { code: 10, category: m },49    p11: { code: 11, category: m },50    p12: { code: 12, category: m },51    p13: { code: 13, category: m },52    p14: { code: 14, category: m },53    p15: { code: 15, category: m },54    p16: { code: 16, category: m },55    p17: { code: 17, category: m },56    p18: { code: 18, category: m },57    p19: { code: 19, category: m },58    p20: { code: 20, category: m },59    p21: { code: 21, category: m },60    p22: { code: 22, category: m },61    p23: { code: 23, category: m },62    p24: { code: 24, category: m },63    p25: { code: 25, category: m },64    p26: { code: 26, category: m },65    p27: { code: 27, category: m },66    p28: { code: 28, category: m },67    p29: { code: 29, category: m },68    p30: { code: 30, category: m },69    p31: { code: 31, category: m },70    p32: { code: 32, category: m },71    p33: { code: 33, category: m },72    p34: { code: 34, category: m },73    p35: { code: 35, category: m },74    p36: { code: 36, category: m },75    p37: { code: 37, category: m },76    p38: { code: 38, category: m },77    p39: { code: 39, category: m },78    p40: { code: 40, category: m },79    p41: { code: 41, category: m },80    p42: { code: 42, category: m },81    p43: { code: 43, category: m },82    p44: { code: 44, category: m },83    p45: { code: 45, category: m },84    p46: { code: 46, category: m },85    p47: { code: 47, category: m },86    p48: { code: 48, category: m },87    p49: { code: 49, category: m },88    p50: { code: 50, category: m },89    p51: { code: 51, category: m },90    p52: { code: 52, category: m },91    p53: { code: 53, category: m },92    p54: { code: 54, category: m },93    p55: { code: 55, category: m },94    p56: { code: 56, category: m },95    p57: { code: 57, category: m },96    p58: { code: 58, category: m },97    p59: { code: 59, category: m },98    p60: { code: 60, category: m },99    p61: { code: 61, category: m },100    p62: { code: 62, category: m },101    p63: { code: 63, category: m },102    p64: { code: 64, category: m },103    p65: { code: 65, category: m },104    p66: { code: 66, category: m },105    p67: { code: 67, category: m },106    p68: { code: 68, category: m },107    p69: { code: 69, category: m },108    p70: { code: 70, category: m },109    p71: { code: 71, category: m },110    p72: { code: 72, category: m },111    p73: { code: 73, category: m },112    p74: { code: 74, category: m },113    p75: { code: 75, category: m },114    p76: { code: 76, category: m },115    p77: { code: 77, category: m },116    p78: { code: 78, category: m },117    p79: { code: 79, category: m },118    p80: { code: 80, category: m },119    p81: { code: 81, category: m },120    p82: { code: 82, category: m },121    p83: { code: 83, category: m },122    p84: { code: 84, category: m },123    p85: { code: 85, category: m },124    p86: { code: 86, category: m },125    p87: { code: 87, category: m },126    p88: { code: 88, category: m },127    p89: { code: 89, category: m },128    p90: { code: 90, category: m },129    p91: { code: 91, category: m },130    p92: { code: 92, category: m },131    p93: { code: 93, category: m },132    p94: { code: 94, category: m },133    p95: { code: 95, category: m },134    p96: { code: 96, category: m },135    p97: { code: 97, category: m },136    p98: { code: 98, category: m },137    p99: { code: 99, category: m },138    p100: { code: 100, category: m },139    p101: { code: 101, category: m },140    p102: { code: 102, category: m },141    p103: { code: 103, category: m },142    p104: { code: 104, category: m },143    p105: { code: 105, category: m },144    p106: { code: 106, category: m },145    p107: { code: 107, category: m },146    p108: { code: 108, category: m },147    p109: { code: 109, category: m },148    p110: { code: 110, category: m },149    p111: { code: 111, category: m },150    p112: { code: 112, category: m },151    p113: { code: 113, category: m },152    p114: { code: 114, category: m },153    p115: { code: 115, category: m },154    p116: { code: 116, category: m },155    p117: { code: 117, category: m },156    p118: { code: 118, category: m },157    p119: { code: 119, category: m },158    p120: { code: 120, category: m },159    p121: { code: 121, category: m },160    p122: { code: 122, category: m },161    p123: { code: 123, category: m },162    p124: { code: 124, category: m },163    p125: { code: 125, category: m },164    p126: { code: 126, category: m },165    p127: { code: 127, category: m },166    p128: { code: 128, category: m },167    p129: { code: 129, category: m },168    p130: { code: 130, category: m },169    p131: { code: 131, category: m },170    p132: { code: 132, category: m },171    p133: { code: 133, category: m },172    p134: { code: 134, category: m },173    p135: { code: 135, category: m },174    p136: { code: 136, category: m },175    p137: { code: 137, category: m },176    p138: { code: 138, category: m },177    p139: { code: 139, category: m },178    p140: { code: 140, category: m },179    p141: { code: 141, category: m },180    p142: { code: 142, category: m },181    p143: { code: 143, category: m },182    p144: { code: 144, category: m },183    p145: { code: 145, category: m },184    p146: { code: 146, category: m },185    p147: { code: 147, category: m },186    p148: { code: 148, category: m },187    p149: { code: 149, category: m },188    p150: { code: 150, category: m },189    p151: { code: 151, category: m },190    p152: { code: 152, category: m },191    p153: { code: 153, category: m },192    p154: { code: 154, category: m },193    p155: { code: 155, category: m },194    p156: { code: 156, category: m },195    p157: { code: 157, category: m },196    p158: { code: 158, category: m },197    p159: { code: 159, category: m },198    p160: { code: 160, category: m },199    p161: { code: 161, category: m },200    p162: { code: 162, category: m },201    p163: { code: 163, category: m },202    p164: { code: 164, category: m },203    p165: { code: 165, category: m },204    p166: { code: 166, category: m },205    p167: { code: 167, category: m },206    p168: { code: 168, category: m },207    p169: { code: 169, category: m },208    p170: { code: 170, category: m },209    p171: { code: 171, category: m },210    p172: { code: 172, category: m },211    p173: { code: 173, category: m },212    p174: { code: 174, category: m },213    p175: { code: 175, category: m },214    p176: { code: 176, category: m },215    p177: { code: 177, category: m },216    p178: { code: 178, category: m },217    p179: { code: 179, category: m },218    p180: { code: 180, category: m },219    p181: { code: 181, category: m },220    p182: { code: 182, category: m },221    p183: { code: 183, category: m },222    p184: { code: 184, category: m },223    p185: { code: 185, category: m },224    p186: { code: 186, category: m },225    p187: { code: 187, category: m },226    p188: { code: 188, category: m },227    p189: { code: 189, category: m },228    p190: { code: 190, category: m },229    p191: { code: 191, category: m },230    p192: { code: 192, category: m },231    p193: { code: 193, category: m },232    p194: { code: 194, category: m },233    p195: { code: 195, category: m },234    p196: { code: 196, category: m },235    p197: { code: 197, category: m },236    p198: { code: 198, category: m },237    p199: { code: 199, category: m },238    p200: { code: 200, category: m },239    p201: { code: 201, category: m },240    p202: { code: 202, category: m },241    p203: { code: 203, category: m },242    p204: { code: 204, category: m },243    p205: { code: 205, category: m },244    p206: { code: 206, category: m },245    p207: { code: 207, category: m },246    p208: { code: 208, category: m },247    p209: { code: 209, category: m },248    p210: { code: 210, category: m },249    p211: { code: 211, category: m },250    p212: { code: 212, category: m },251    p213: { code: 213, category: m },252    p214: { code: 214, category: m },253    p215: { code: 215, category: m },254    p216: { code: 216, category: m },255    p217: { code: 217, category: m },256    p218: { code: 218, category: m },257    p219: { code: 219, category: m },258    p220: { code: 220, category: m },259    p221: { code: 221, category: m },260    p222: { code: 222, category: m },261    p223: { code: 223, category: m },262    p224: { code: 224, category: m },263    p225: { code: 225, category: m },264    p226: { code: 226, category: m },265    p227: { code: 227, category: m },266    p228: { code: 228, category: m },267    p229: { code: 229, category: m },268    p230: { code: 230, category: m },269    p231: { code: 231, category: m },270    p232: { code: 232, category: m },271    p233: { code: 233, category: m },272    p234: { code: 234, category: m },273    p235: { code: 235, category: m },274    p236: { code: 236, category: m },275    p237: { code: 237, category: m },276    p238: { code: 238, category: m },277    p239: { code: 239, category: m },278    p240: { code: 240, category: m },279    p241: { code: 241, category: m },280    p242: { code: 242, category: m },281    p243: { code: 243, category: m },282    p244: { code: 244, category: m },283    p245: { code: 245, category: m },284    p246: { code: 246, category: m },285    p247: { code: 247, category: m },286    p248: { code: 248, category: m },287    p249: { code: 249, category: m },288    p250: { code: 250, category: m },289    p251: { code: 251, category: m },290    p252: { code: 252, category: m },291    p253: { code: 253, category: m },292    p254: { code: 254, category: m },293    p255: { code: 255, category: m },294    p256: { code: 256, category: m },295    p257: { code: 257, category: m },296    p258: { code: 258, category: m },297    p259: { code: 259, category: m },298    p260: { code: 260, category: m },299    p261: { code: 261, category: m },300    p262: { code: 262, category: m },301    p263: { code: 263, category: m },302    p264: { code: 264, category: m },303    p265: { code: 265, category: m },304    p266: { code: 266, category: m },305    p267: { code: 267, category: m },306    p268: { code: 268, category: m },307    p269: { code: 269, category: m },308    p270: { code: 270, category: m },309    p271: { code: 271, category: m },310    p272: { code: 272, category: m },311    p273: { code: 273, category: m },312    p274: { code: 274, category: m },313    p275: { code: 275, category: m },314    p276: { code: 276, category: m },315    p277: { code: 277, category: m },316    p278: { code: 278, category: m },317    p279: { code: 279, category: m },318    p280: { code: 280, category: m },319    p281: { code: 281, category: m },320    p282: { code: 282, category: m },321    p283: { code: 283, category: m },322    p284: { code: 284, category: m },323    p285: { code: 285, category: m },324    p286: { code: 286, category: m },325    p287: { code: 287, category: m },326    p288: { code: 288, category: m },327    p289: { code: 289, category: m },328    p290: { code: 290, category: m },329    p291: { code: 291, category: m },330    p292: { code: 292, category: m },331    p293: { code: 293, category: m },332    p294: { code: 294, category: m },333    p295: { code: 295, category: m },334    p296: { code: 296, category: m },335    p297: { code: 297, category: m },336    p298: { code: 298, category: m },337    p299: { code: 299, category: m },338    p300: { code: 300, category: m },339    p301: { code: 301, category: m },340    p302: { code: 302, category: m },341    p303: { code: 303, category: m },342    p304: { code: 304, category: m },343    p305: { code: 305, category: m },344    p306: { code: 306, category: m },345    p307: { code: 307, category: m },346    p308: { code: 308, category: m },347    p309: { code: 309, category: m },348    p310: { code: 310, category: m },349    p311: { code: 311, category: m },350    p312: { code: 312, category: m },351    p313: { code: 313, category: m },352    p314: { code: 314, category: m },353    p315: { code: 315, category: m },354    p316: { code: 316, category: m },355    p317: { code: 317, category: m },356    p318: { code: 318, category: m },357    p319: { code: 319, category: m },358    p320: { code: 320, category: m },359    p321: { code: 321, category: m },360    p322: { code: 322, category: m },361    p323: { code: 323, category: m },362    p324: { code: 324, category: m },363    p325: { code: 325, category: m },364    p326: { code: 326, category: m },365    p327: { code: 327, category: m },366    p328: { code: 328, category: m },367    p329: { code: 329, category: m },368    p330: { code: 330, category: m },369    p331: { code: 331, category: m },370    p332: { code: 332, category: m },371    p333: { code: 333, category: m },372    p334: { code: 334, category: m },373    p335: { code: 335, category: m },374    p336: { code: 336, category: m },375    p337: { code: 337, category: m },376    p338: { code: 338, category: m },377    p339: { code: 339, category: m },378    p340: { code: 340, category: m },379    p341: { code: 341, category: m },380    p342: { code: 342, category: m },381    p343: { code: 343, category: m },382    p344: { code: 344, category: m },383    p345: { code: 345, category: m },384    p346: { code: 346, category: m },385    p347: { code: 347, category: m },386    p348: { code: 348, category: m },387    p349: { code: 349, category: m },388    p350: { code: 350, category: m },389    p351: { code: 351, category: m },390    p352: { code: 352, category: m },391    p353: { code: 353, category: m },392    p354: { code: 354, category: m },393    p355: { code: 355, category: m },394    p356: { code: 356, category: m },395    p357: { code: 357, category: m },396    p358: { code: 358, category: m },397    p359: { code: 359, category: m },398    p360: { code: 360, category: m },399    p361: { code: 361, category: m },400    p362: { code: 362, category: m },401    p363: { code: 363, category: m },402    p364: { code: 364, category: m },403    p365: { code: 365, category: m },404    p366: { code: 366, category: m },405    p367: { code: 367, category: m },406    p368: { code: 368, category: m },407    p369: { code: 369, category: m },408    p370: { code: 370, category: m },409    p371: { code: 371, category: m },410    p372: { code: 372, category: m },411    p373: { code: 373, category: m },412    p374: { code: 374, category: m },413    p375: { code: 375, category: m },414    p376: { code: 376, category: m },415    p377: { code: 377, category: m },416    p378: { code: 378, category: m },417    p379: { code: 379, category: m },418    p380: { code: 380, category: m },419    p381: { code: 381, category: m },420    p382: { code: 382, category: m },421    p383: { code: 383, category: m },422    p384: { code: 384, category: m },423    p385: { code: 385, category: m },424    p386: { code: 386, category: m },425    p387: { code: 387, category: m },426    p388: { code: 388, category: m },427    p389: { code: 389, category: m },428    p390: { code: 390, category: m },429    p391: { code: 391, category: m },430    p392: { code: 392, category: m },431    p393: { code: 393, category: m },432    p394: { code: 394, category: m },433    p395: { code: 395, category: m },434    p396: { code: 396, category: m },435    p397: { code: 397, category: m },436    p398: { code: 398, category: m },437    p399: { code: 399, category: m },438    p400: { code: 400, category: m },439    p401: { code: 401, category: m },440    p402: { code: 402, category: m },441    p403: { code: 403, category: m },442    p404: { code: 404, category: m },443    p405: { code: 405, category: m },444    p406: { code: 406, category: m },445    p407: { code: 407, category: m },446    p408: { code: 408, category: m },447    p409: { code: 409, category: m },448    p410: { code: 410, category: m },449    p411: { code: 411, category: m },450    p412: { code: 412, category: m },451    p413: { code: 413, category: m },452    p414: { code: 414, category: m },453    p415: { code: 415, category: m },454    p416: { code: 416, category: m },455    p417: { code: 417, category: m },456    p418: { code: 418, category: m },457    p419: { code: 419, category: m },458    p420: { code: 420, category: m },459    p421: { code: 421, category: m },460    p422: { code: 422, category: m },461    p423: { code: 423, category: m },462    p424: { code: 424, category: m },463    p425: { code: 425, category: m },464    p426: { code: 426, category: m },465    p427: { code: 427, category: m },466    p428: { code: 428, category: m },467    p429: { code: 429, category: m },468    p430: { code: 430, category: m },469    p431: { code: 431, category: m },470    p432: { code: 432, category: m },471    p433: { code: 433, category: m },472    p434: { code: 434, category: m },473    p435: { code: 435, category: m },474    p436: { code: 436, category: m },475    p437: { code: 437, category: m },476    p438: { code: 438, category: m },477    p439: { code: 439, category: m },478    p440: { code: 440, category: m },479    p441: { code: 441, category: m },480    p442: { code: 442, category: m },481    p443: { code: 443, category: m },482    p444: { code: 444, category: m },483    p445: { code: 445, category: m },484    p446: { code: 446, category: m },485    p447: { code: 447, category: m },486    p448: { code: 448, category: m },487    p449: { code: 449, category: m },488    p450: { code: 450, category: m },489    p451: { code: 451, category: m },490    p452: { code: 452, category: m },491    p453: { code: 453, category: m },492    p454: { code: 454, category: m },493    p455: { code: 455, category: m },494    p456: { code: 456, category: m },495    p457: { code: 457, category: m },496    p458: { code: 458, category: m },497    p459: { code: 459, category: m },498    p460: { code: 460, category: m },499    p461: { code: 461, category: m },500    p462: { code: 462, category: m },501    p463: { code: 463, category: m },502    p464: { code: 464, category: m },503    p465: { code: 465, category: m },504    p466: { code: 466, category: m },505    p467: { code: 467, category: m },506    p468: { code: 468, category: m },507    p469: { code: 469, category: m },508    p470: { code: 470, category: m },509    p471: { code: 471, category: m },510    p472: { code: 472, category: m },511    p473: { code: 473, category: m },512    p474: { code: 474, category: m },513    p475: { code: 475, category: m },514    p476: { code: 476, category: m },515    p477: { code: 477, category: m },516    p478: { code: 478, category: m },517    p479: { code: 479, category: m },518    p480: { code: 480, category: m },519    p481: { code: 481, category: m },520    p482: { code: 482, category: m },521    p483: { code: 483, category: m },522    p484: { code: 484, category: m },523    p485: { code: 485, category: m },524    p486: { code: 486, category: m },525    p487: { code: 487, category: m },526    p488: { code: 488, category: m },527    p489: { code: 489, category: m },528    p490: { code: 490, category: m },529    p491: { code: 491, category: m },530    p492: { code: 492, category: m },531    p493: { code: 493, category: m },532    p494: { code: 494, category: m },533    p495: { code: 495, category: m },534    p496: { code: 496, category: m },535    p497: { code: 497, category: m },536    p498: { code: 498, category: m },537    p499: { code: 499, category: m }538};539var AccessorProperty = Java.type("jdk.nashorn.internal.runtime.AccessorProperty");540var SpillProperty    = Java.type("jdk.nashorn.internal.runtime.SpillProperty");541var PropertyMap = Java.type("jdk.nashorn.internal.runtime.PropertyMap");542var findPropertyMethod = PropertyMap.class.getMethod("findProperty", java.lang.Object.class);543Assert.assertTrue(Object.keys(fields).length === 3);544Assert.assertTrue(findPropertyMethod.invoke(Debug.map(fields), "p0").getClass() === AccessorProperty.class);545Assert.assertTrue(findPropertyMethod.invoke(Debug.map(fields), "p2").getClass() === AccessorProperty.class);546Assert.assertTrue(Object.keys(spill).length === 500);547Assert.assertTrue(findPropertyMethod.invoke(Debug.map(spill), "p0").getClass() === SpillProperty.class);...jquery.notice-categories.js
Source:jquery.notice-categories.js  
1function validateString(input,ml) {2	$(input).change(function(){3		if($.trim($(this).val()).length < ml) {4			$(this).addClass('error');5		} else {6			$(this).removeClass('error');7		}8	});	9}10function validateNumber(input,dv) {11	$(input).change(function(){12		var iv = parseInt($(this).val().match(/\d+/));13		if (isNaN(iv)) {14			iv = dv;15		}16		$(this).val(iv);17	});18}19function validateName(input) {20	$(input).change(function(){21		if($.trim($(this).val()).length > 0) {22			var type = $('#edit-type').val();23			var id   = $('#edit-id').val();24			var name = $(this).val();	25			$.post(base_url + '/ajax/admin_check_category', { type: type, id: id, name: name, slug: '' },26				function (response) {27					if (response.status) {28						if(response.name) {29							$('#edit-name').addClass('error');					30						} else {31							$('#edit-name').removeClass('error');32						}33					} else {34					}35			}, "json"); 		36		}37	});38}39function hasErrors(input) {40	var err = false;41	$(input).each(function(){		42		if($(this).hasClass('error')) {43			err = true;44		}45	});46	return err;47}48function thumbLoaded(category_id) {49	var imgs = $('#category-thumbnail-container img').not(function() { return this.complete; });50	var count = imgs.length;51	imgs.each(function() {52		$(this).error(function() {53			$(this).attr('src', base_url + '/media/categories/default.jpg');54		});	55	});	56	if (count) {57		imgs.load(function() {58			count--;59			if (!count) {60				$('#thumb_category_' + category_id).html('<i class="fa fa-picture-o"></i>');61				$('#category-thumbnailModal').modal('show');				62			}63		});64	} else {65		$('#thumb_category_' + category_id).html('<i class="fa fa-picture-o"></i>');66		$('#category-thumbnailModal').modal('show');		67	}68}69function startUpload() {70	$('#category-thumbnail-loading').show();71	return true;72}73function stopUpload(cid, uploaded) {74	var result = '';75	var type = $('#category-thumbnail-type').val();76	if (uploaded) {77		$('#addthumb').replaceWith($('#addthumb').val('').clone(true));78		$('#upaddthumb').html($('#nofile').val());		79		d = new Date();	80		$("#category-thumbnail-img-" + cid).attr("src", base_url + '/media/categories/'+ type +'/' + cid + '.jpg?' + d.getTime());81		$("#thumb-" + cid).attr("src", base_url + '/media/categories/' + type + '/' + cid + '.jpg?' + d.getTime());82		Messenger().post({83			message: 'Category <b>ID ' + cid + '</b>: Thumbnail successfully updated!',84			type: 'success'85		});86	}87	else {88		Messenger().post({89		message: 'Category <b>ID ' + cid + '</b>: Thumbnail updating failed!',90			type: 'error'91		});			 92	}93	$('#category-thumbnail-loading').hide();	  94	return true;   95}96$(document).ready(function(){97		98	$( "#reset_search" ).click(function() {99		document.getElementById('sort_items').innerText = 'ID';100		document.getElementById('sort').value = 'category_id';101		document.getElementById('order_items').innerText = 'Descending';102		document.getElementById('order').value = 'DESC';		103	});	104	//Ajax:105	106	//Delete107    $("body").on('click', "a[id*='delete_category_']", function(event) {108        event.preventDefault();	109		var id = $(this).attr('id');110		var split = id.split('_');111		var category_type = split[2];		112		var category_id = split[3];113		$('#delete__category_' + category_id).html('<i class="small-loader"></i>');114		$('#' + id).html('<i class="small-loader"></i>');115		$.post(base_url + '/ajax/admin_delete_category', { category_type: category_type, category_id: category_id },116			function (response) {117				if (response.status) {118					Messenger().post({119						message: 'Category <b>ID ' + category_id + '</b>: Successfully deleted!',120						type: 'success'121					});122					$('#item-' + category_id).fadeOut();123				} else {124					Messenger().post({125						message: 'Category <b>ID ' + category_id + '</b>: Delete failed!',126						type: 'error'127					});					128				}129		}, "json"); 130	});131	//Edit Category132    $("body").on('click', "a[id*='edit_category_']", function(event) {133        event.preventDefault();134		var id = $(this).attr('id');135		var split = id.split('_');136		var category_type = split[2];		137		var category_id = split[3];138		//Load Category Data139		$('#edit-type-span-1').text(category_type);140		$('#edit-type-span-2').text(category_type + 's');141		$('#edit-id-span').text(category_id);142		$('#edit-id').val(category_id);143		$('#edit-type').val(category_type);		144		$('#edit-name').val($('#title-' + category_id).text());145		$('#edit-slug-container').hide();146		$('#edit-status-container').show();147		if($('#status-' + category_id).find('span').text() == 'Active' ) {148			$('input:radio[name="edit-status"]').filter('[value="1"]').attr('checked', true);149		} else {150			$('input:radio[name="edit-status"]').filter('[value="0"]').attr('checked', true);151		}152		$('#edit-update-counter').attr('checked', false);	153		154		//Reset Errors155		$('.form-control').each(function(){156			$(this).removeClass('error');157		});		158		159		//Adjust margin left to integer value - Center160		var modal_ml = parseInt(($(window).width()-$('#editModalDialog').width())/2);					161		$('#editModal').modal('show');162		if ($(window).width()>768) {163			$('#editModalDialog').css('margin-left',Math.floor(modal_ml)+'px');164		}165				166		$('#editModal').modal('show');167		168	});	169	//Reset170	$("body").on('click', "button[id='edit-reset']", function(event) {171        event.preventDefault();172		var category_id = $('#edit-id').val();173		//Reset Errors174		$('.form-control').each(function(){175			$(this).removeClass('error');176		});177		178		//Load Category Data179		$('#edit-name').val($('#title-' + category_id).text());180		$('#edit-update-counter').attr('checked', false);181		if($('#status-' + category_id).find('span').text() == 'Active' ) {182			$('input:radio[name="edit-status"]').filter('[value="1"]').attr('checked', true);183		} else {184			$('input:radio[name="edit-status"]').filter('[value="0"]').attr('checked', true);185		}		186				187	});	188	189	//Edit Save190	$("body").on('click', "button[id='edit-save']", function(event) {		191		event.preventDefault();192		var category_id   = $('#edit-id').val();193		var category_type = $('#edit-type').val();194		var counter = false;195		if ($('#edit-update-counter').is(":checked")) {196		  counter = true;197		}		198		if (!hasErrors("input[id*='edit-']")) {199			//save code200			$('#edit_category_' + category_id).html('<i class="small-loader"></i>');			201			var categoryData = {202				id 		     : $('#edit-id').val(),203				type	     : $('#edit-type').val(),204				name 		 : $('#edit-name').val(),				205				slug		 : '',206				active		: $('input[name="edit-status"]:checked').val(),				207				counter 	 : counter208			};209			var jsonCategoryData = JSON.stringify(categoryData);210			211			$.post(base_url + '/ajax/admin_save_category', { data: jsonCategoryData },212				function (response) {					213					$('#editModal').modal('hide');214					if (response.status) {						215						Messenger().post({216							message: 'Category <b>ID ' + category_id + '</b>: Successfully updated!',217							type: 'success'218						});219						$('#title-' + category_id).text(response.name);220						$('#slug-' + category_id).text(response.slug);221						if (response.total != null) {222							$('#total-items-' + category_id).text(response.total);223						}224						if (categoryData.active == 1) {225							$('#status_category_' + category_id).attr('data-status', 1);							226							$('#status_category_' + category_id).attr('alt', 'Suspend');227							$('#status_category_' + category_id).attr('name', 'Suspend');228							$('#status_category_' + category_id).html('<i class="fa fa-times"></i>');229							$('#status-' + category_id).html('<span class="text-green" alt="Active" name="Active">Active</span>');							230						} else {231							$('#status_category_' + category_id).attr('data-status', 0);232							$('#status_category_' + category_id).attr('alt', 'Activate');233							$('#status_category_' + category_id).attr('name', 'Activate');234							$('#status_category_' + category_id).html('<i class="fa fa-check"></i>');235							$('#status-' + category_id).html('<span class="text-red" alt="Inactive" name="Inactive">Inactive</span>');236						}							237					} else {238						Messenger().post({239							message: 'Category <b>ID ' + category_id + '</b>: Failed updating!',240							type: 'error'241						});242					}243					$('#edit_category_' + category_id).html('<i class="fa fa-pencil"></i>');	244			}, "json");			245		}246		247	});248	//Status249    $("body").on('click', "a[id*='status_category_']", function(event) {250        event.preventDefault();251		var processing = $(this).attr('data-processing');252		if (processing == 0) {253			$(this).attr('data-processing', 1);	254			var category_status = $(this).attr('data-status');255			var id = $(this).attr('id');256			var split = id.split('_');257			var category_id = split[2];258			$('#' + id).html('<i class="small-loader"></i>');259			$.post(base_url + '/ajax/admin_status_category', { category_id: category_id, category_status: category_status},260				function (response) {261					if (response.status) {262						if (category_status == 0) {263							Messenger().post({264								message: 'Category <b>ID ' + category_id + '</b>: Successfully activated!',265								type: 'success'266							});						267							$('#status_category_' + category_id).attr('data-status', 1);							268							$('#status_category_' + category_id).attr('alt', 'Suspend');269							$('#status_category_' + category_id).attr('title', 'Suspend');270							$('#status_category_' + category_id).html('<i class="fa fa-times"></i>');271							$('#status-' + category_id).html('<span class="text-green" alt="Active" title="Active">Active</span>');							272						} else {273							Messenger().post({274								message: 'Category <b>ID ' + category_id + '</b>: Successfully suspended!',275								type: 'success'276							});277							$('#status_category_' + category_id).attr('data-status', 0);278							$('#status_category_' + category_id).attr('alt', 'Activate');279							$('#status_category_' + category_id).attr('title', 'Activate');280							$('#status_category_' + category_id).html('<i class="fa fa-check"></i>');281							$('#status-' + category_id).html('<span class="text-red" alt="Inactive" title="Inactive">Inactive</span>');282						}283					} else {284						if (category_status == 0) {285							Messenger().post({286								message: 'Category <b>ID ' + category_id + '</b>: Failed activating or already active!',287								type: 'error'288							});289							$('#status_category_' + category_id).html('<i class="fa fa-check"></i>');							290						} else {291							Messenger().post({292								message: 'Category <b>ID ' + category_id + '</b>: Failed suspending or already inactive!',293								type: 'error'294							});295							$('#status_category_' + category_id).html('<i class="fa fa-times"></i>');							296						}297					}298					$('#status_category_' + category_id).attr('data-processing', 0);299			}, "json"); 			300		}301	});	302	//Validate303	validateString('#edit-name',1);304	validateName('#edit-name');305	...sre_constants.py
Source:sre_constants.py  
1#2# Secret Labs' Regular Expression Engine3#4# various symbols used by the regular expression engine.5# run this script to update the _sre include files!6#7# Copyright (c) 1998-2001 by Secret Labs AB.  All rights reserved.8#9# See the sre.py file for information on usage and redistribution.10#11"""Internal support module for sre"""12# update when constants are added or removed13MAGIC = 2003101714try:15    from _sre import MAXREPEAT16except ImportError:17    import _sre18    MAXREPEAT = _sre.MAXREPEAT = 6553519# SRE standard exception (access as sre.error)20# should this really be here?21class error(Exception):22    pass23# operators24FAILURE = "failure"25SUCCESS = "success"26ANY = "any"27ANY_ALL = "any_all"28ASSERT = "assert"29ASSERT_NOT = "assert_not"30AT = "at"31BIGCHARSET = "bigcharset"32BRANCH = "branch"33CALL = "call"34CATEGORY = "category"35CHARSET = "charset"36GROUPREF = "groupref"37GROUPREF_IGNORE = "groupref_ignore"38GROUPREF_EXISTS = "groupref_exists"39IN = "in"40IN_IGNORE = "in_ignore"41INFO = "info"42JUMP = "jump"43LITERAL = "literal"44LITERAL_IGNORE = "literal_ignore"45MARK = "mark"46MAX_REPEAT = "max_repeat"47MAX_UNTIL = "max_until"48MIN_REPEAT = "min_repeat"49MIN_UNTIL = "min_until"50NEGATE = "negate"51NOT_LITERAL = "not_literal"52NOT_LITERAL_IGNORE = "not_literal_ignore"53RANGE = "range"54REPEAT = "repeat"55REPEAT_ONE = "repeat_one"56SUBPATTERN = "subpattern"57MIN_REPEAT_ONE = "min_repeat_one"58# positions59AT_BEGINNING = "at_beginning"60AT_BEGINNING_LINE = "at_beginning_line"61AT_BEGINNING_STRING = "at_beginning_string"62AT_BOUNDARY = "at_boundary"63AT_NON_BOUNDARY = "at_non_boundary"64AT_END = "at_end"65AT_END_LINE = "at_end_line"66AT_END_STRING = "at_end_string"67AT_LOC_BOUNDARY = "at_loc_boundary"68AT_LOC_NON_BOUNDARY = "at_loc_non_boundary"69AT_UNI_BOUNDARY = "at_uni_boundary"70AT_UNI_NON_BOUNDARY = "at_uni_non_boundary"71# categories72CATEGORY_DIGIT = "category_digit"73CATEGORY_NOT_DIGIT = "category_not_digit"74CATEGORY_SPACE = "category_space"75CATEGORY_NOT_SPACE = "category_not_space"76CATEGORY_WORD = "category_word"77CATEGORY_NOT_WORD = "category_not_word"78CATEGORY_LINEBREAK = "category_linebreak"79CATEGORY_NOT_LINEBREAK = "category_not_linebreak"80CATEGORY_LOC_WORD = "category_loc_word"81CATEGORY_LOC_NOT_WORD = "category_loc_not_word"82CATEGORY_UNI_DIGIT = "category_uni_digit"83CATEGORY_UNI_NOT_DIGIT = "category_uni_not_digit"84CATEGORY_UNI_SPACE = "category_uni_space"85CATEGORY_UNI_NOT_SPACE = "category_uni_not_space"86CATEGORY_UNI_WORD = "category_uni_word"87CATEGORY_UNI_NOT_WORD = "category_uni_not_word"88CATEGORY_UNI_LINEBREAK = "category_uni_linebreak"89CATEGORY_UNI_NOT_LINEBREAK = "category_uni_not_linebreak"90OPCODES = [91    # failure=0 success=1 (just because it looks better that way :-)92    FAILURE, SUCCESS,93    ANY, ANY_ALL,94    ASSERT, ASSERT_NOT,95    AT,96    BRANCH,97    CALL,98    CATEGORY,99    CHARSET, BIGCHARSET,100    GROUPREF, GROUPREF_EXISTS, GROUPREF_IGNORE,101    IN, IN_IGNORE,102    INFO,103    JUMP,104    LITERAL, LITERAL_IGNORE,105    MARK,106    MAX_UNTIL,107    MIN_UNTIL,108    NOT_LITERAL, NOT_LITERAL_IGNORE,109    NEGATE,110    RANGE,111    REPEAT,112    REPEAT_ONE,113    SUBPATTERN,114    MIN_REPEAT_ONE115]116ATCODES = [117    AT_BEGINNING, AT_BEGINNING_LINE, AT_BEGINNING_STRING, AT_BOUNDARY,118    AT_NON_BOUNDARY, AT_END, AT_END_LINE, AT_END_STRING,119    AT_LOC_BOUNDARY, AT_LOC_NON_BOUNDARY, AT_UNI_BOUNDARY,120    AT_UNI_NON_BOUNDARY121]122CHCODES = [123    CATEGORY_DIGIT, CATEGORY_NOT_DIGIT, CATEGORY_SPACE,124    CATEGORY_NOT_SPACE, CATEGORY_WORD, CATEGORY_NOT_WORD,125    CATEGORY_LINEBREAK, CATEGORY_NOT_LINEBREAK, CATEGORY_LOC_WORD,126    CATEGORY_LOC_NOT_WORD, CATEGORY_UNI_DIGIT, CATEGORY_UNI_NOT_DIGIT,127    CATEGORY_UNI_SPACE, CATEGORY_UNI_NOT_SPACE, CATEGORY_UNI_WORD,128    CATEGORY_UNI_NOT_WORD, CATEGORY_UNI_LINEBREAK,129    CATEGORY_UNI_NOT_LINEBREAK130]131def makedict(list):132    d = {}133    i = 0134    for item in list:135        d[item] = i136        i = i + 1137    return d138OPCODES = makedict(OPCODES)139ATCODES = makedict(ATCODES)140CHCODES = makedict(CHCODES)141# replacement operations for "ignore case" mode142OP_IGNORE = {143    GROUPREF: GROUPREF_IGNORE,144    IN: IN_IGNORE,145    LITERAL: LITERAL_IGNORE,146    NOT_LITERAL: NOT_LITERAL_IGNORE147}148AT_MULTILINE = {149    AT_BEGINNING: AT_BEGINNING_LINE,150    AT_END: AT_END_LINE151}152AT_LOCALE = {153    AT_BOUNDARY: AT_LOC_BOUNDARY,154    AT_NON_BOUNDARY: AT_LOC_NON_BOUNDARY155}156AT_UNICODE = {157    AT_BOUNDARY: AT_UNI_BOUNDARY,158    AT_NON_BOUNDARY: AT_UNI_NON_BOUNDARY159}160CH_LOCALE = {161    CATEGORY_DIGIT: CATEGORY_DIGIT,162    CATEGORY_NOT_DIGIT: CATEGORY_NOT_DIGIT,163    CATEGORY_SPACE: CATEGORY_SPACE,164    CATEGORY_NOT_SPACE: CATEGORY_NOT_SPACE,165    CATEGORY_WORD: CATEGORY_LOC_WORD,166    CATEGORY_NOT_WORD: CATEGORY_LOC_NOT_WORD,167    CATEGORY_LINEBREAK: CATEGORY_LINEBREAK,168    CATEGORY_NOT_LINEBREAK: CATEGORY_NOT_LINEBREAK169}170CH_UNICODE = {171    CATEGORY_DIGIT: CATEGORY_UNI_DIGIT,172    CATEGORY_NOT_DIGIT: CATEGORY_UNI_NOT_DIGIT,173    CATEGORY_SPACE: CATEGORY_UNI_SPACE,174    CATEGORY_NOT_SPACE: CATEGORY_UNI_NOT_SPACE,175    CATEGORY_WORD: CATEGORY_UNI_WORD,176    CATEGORY_NOT_WORD: CATEGORY_UNI_NOT_WORD,177    CATEGORY_LINEBREAK: CATEGORY_UNI_LINEBREAK,178    CATEGORY_NOT_LINEBREAK: CATEGORY_UNI_NOT_LINEBREAK179}180# flags181SRE_FLAG_TEMPLATE = 1 # template mode (disable backtracking)182SRE_FLAG_IGNORECASE = 2 # case insensitive183SRE_FLAG_LOCALE = 4 # honour system locale184SRE_FLAG_MULTILINE = 8 # treat target as multiline string185SRE_FLAG_DOTALL = 16 # treat target as a single string186SRE_FLAG_UNICODE = 32 # use unicode locale187SRE_FLAG_VERBOSE = 64 # ignore whitespace and comments188SRE_FLAG_DEBUG = 128 # debugging189# flags for INFO primitive190SRE_INFO_PREFIX = 1 # has prefix191SRE_INFO_LITERAL = 2 # entire pattern is literal (given by prefix)192SRE_INFO_CHARSET = 4 # pattern starts with character from given set193if __name__ == "__main__":194    def dump(f, d, prefix):195        items = d.items()196        items.sort(key=lambda a: a[1])197        for k, v in items:198            f.write("#define %s_%s %s\n" % (prefix, k.upper(), v))199    f = open("sre_constants.h", "w")200    f.write("""\201/*202 * Secret Labs' Regular Expression Engine203 *204 * regular expression matching engine205 *206 * NOTE: This file is generated by sre_constants.py.  If you need207 * to change anything in here, edit sre_constants.py and run it.208 *209 * Copyright (c) 1997-2001 by Secret Labs AB.  All rights reserved.210 *211 * See the _sre.c file for information on usage and redistribution.212 */213""")214    f.write("#define SRE_MAGIC %d\n" % MAGIC)215    dump(f, OPCODES, "SRE_OP")216    dump(f, ATCODES, "SRE")217    dump(f, CHCODES, "SRE")218    f.write("#define SRE_FLAG_TEMPLATE %d\n" % SRE_FLAG_TEMPLATE)219    f.write("#define SRE_FLAG_IGNORECASE %d\n" % SRE_FLAG_IGNORECASE)220    f.write("#define SRE_FLAG_LOCALE %d\n" % SRE_FLAG_LOCALE)221    f.write("#define SRE_FLAG_MULTILINE %d\n" % SRE_FLAG_MULTILINE)222    f.write("#define SRE_FLAG_DOTALL %d\n" % SRE_FLAG_DOTALL)223    f.write("#define SRE_FLAG_UNICODE %d\n" % SRE_FLAG_UNICODE)224    f.write("#define SRE_FLAG_VERBOSE %d\n" % SRE_FLAG_VERBOSE)225    f.write("#define SRE_INFO_PREFIX %d\n" % SRE_INFO_PREFIX)226    f.write("#define SRE_INFO_LITERAL %d\n" % SRE_INFO_LITERAL)227    f.write("#define SRE_INFO_CHARSET %d\n" % SRE_INFO_CHARSET)228    f.close()...Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!
