30,000 data in column A, 8,000 data in column B, find the same value in the same two columns, php implementation
There are 30,000 pieces of data in column A, and 8,000 pieces of data in column B. Find out how many values are the same in the two columns, and list the details. The data type is int. How to implement it in php? My idea is to convert the two columns into arrays and then compare them, but it needs to loop 30,000*8,000 times. It is painful to think about it. How to cut the 30,000 pieces of data reasonably and then compare them? Seek great ideas Response content: There are 30,000 pieces of data in column A, and 8,000 pieces of data in column B. Find out how many values are the same in the two columns, and list the details. The data type is int. How to implement it in php? My idea is to convert the two columns into arrays and then compare them, but it needs to loop 30,000*8,000 times. It is painful to think about it. How to cut the 30,000 pieces of data reasonably and then compare them? Seek great ideas mod range, simply take {1-100} and {2,13,24,35} as an example, Every 10 can be an interval, that is, 0-9, 10-19… Then 0-9…
30,000 data in column A, 8,000 data in column B, find the same value in the same two columns, php implementation
There are 30,000 pieces of data in column A, and 8,000 pieces of data in column B. Find out how many values are the same in the two columns, and list the details. The data type is int. How to implement it in php? My idea is to convert the two columns into arrays and then compare them, but it needs to loop 30,000*8,000 times. It is painful to think about it. How to cut the 30,000 pieces of data reasonably and then compare them? Seek great ideas Response content: There are 30,000 pieces of data in column A, and 8,000 pieces of data in column B. Find out how many values are the same in the two columns, and list the details. The data type is int. How to implement it in php? My idea is to convert the two columns into arrays and then compare them, but it needs to loop 30,000*8,000 times. It is painful to think about it. How to cut the 30,000 pieces of data reasonably and then compare them? Seek great ideas mod range, simply take {1-100} and {2,13,24,35} as an example, Every 10 can be an interval, that is, 0-9, 10-19… Then 0-9…
Example analysis of PHP base conversion (2,8,16,36,64 base to decimal conversion)
The example in this article describes the PHP binary conversion. Share it with everyone for your reference, as follows: Achievable: Decimal conversion 2, 8, 16, 36, 62 base 2, 8, 16, 36, 62 base conversion to decimal It should be noted that when converting 2, 8, and 16 hexadecimals, the system’s own functions are used. So, the high-precision conversion value may be greater than 2147483646 anyway. Additionally, 32 base low-precision conversion, maximum value: 2147483646; 32-ary high-precision conversion, the maximum value: 77309411327; Hexadecimal high-precision conversion, the maximum value: 133143986175. The jinzhi.php file has its own demo function. Hexadecimal conversion/title> 2 8 10 16 36 62 Base Do Ordinaryhigh precision translates to 2 8 10 16 36 62 Hexadecimal, The total length is character. Note: Only decimal can be converted to 2, 8, 16, 36, 62; or vice versa. =10) { $zifu.= chr(($linshi+55)); }else{ $zifu.= $linshi;} break; case 62: if (($linshi>=10) && ($linshi36)) {$zifu.= chr($linshi+55);break;} if (($linshi>=36) && ($linshi62)) {$zifu.= chr($linshi+61);break;} $zifu.= $linshi;break; default: $zifu.= $linshi; break; } $shu = intval($shu/$jinzhi); } for ($i=strlen($zifu);$i$w;$i++) $zifu.=”0″; return strrev($zifu);} //2, 8, 16, 36, 62 to decimal function jinzhih_1($zifu,$jinzhi,$w) { $shu=0; for ($i=0;$i=strlen($zifu)-1;$i++) { $linshi = substr($zifu,$i,1); switch ($jinzhi){ case 2: $shu = bindec($zifu); $i=strlen($zifu)+1;…
underscore knowledge points_error: partition(s) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,_cily_undefined’s blog
1. Installation Node. js –> npm install underscore Meteor.js –> meteor add underscore Require.js –> require([“underscore”], … Bower bower –> install underscore Component –> component install jashkenas/underscore Second, aggregate function (array or object) 1, each Syntax: _.each(list, iteratee, [context]) Description: Traverse all elements in the list, and call the iteratee function with each element as a parameter in order. If the context parameter is passed, bind iteratee to the context object. Each call to iteratee passes three parameters: (element, index, list). If list is a JavaScript object, the arguments to iteratee are (value, key, list)). Return a list to facilitate chain calls. Example: _.each([1, 2, 3], alert); => alerts each number in turn… _.each({one: 1, two: 2, three: 3}, alert); => alerts each number value in turn… 2, map Syntax: _.map(list, iteratee, [context]) Description: Generate a corresponding array by calling the conversion function (iteratee iterator) for each element in the list. iteratee passes three parameters: value, then the iteration index (or key Fool’s Wharf note: if the list is a JavaScript object, this parameter is the key), and the last one is a reference to the entire list. Example: _.map([1, 2, 3], function(num){ return num * 3; }); => [3,…