Category : algorithm

I’m trying to create a replenish list for warehouse workers, who will walk around a warehouse picking products in orders. First, I wanna show Order Data and storage data Orders Data Storage Data Logic Storage Must order By Exp_date, location type, and location_id If storage qty bigger than left outstanding make replenishment If has remain ..

Read more

Here’s the problem i’m trying to use the algorithm and have followed the instruction This is my code in config/encryption.php this is my public function commit in controller, along with the library encrypter And this the error, caused by emptying public key in config/encryption.php what i don’t get, isn’t that the program: $key = CodeIgniterEncryptionEncryption::createKey(); ..

Read more

I have an algorithm issue I can’t manage to complete. Let’s take the following example : $array[‘toto’][] = rand(0,10); $array[‘toto’][] = rand(0,10); $array[‘toto’][] = rand(0,10); $array[‘titi’][] = rand(0,10); $array[‘titi’][] = rand(0,10); $array[‘other’][] = rand(0,10); $array[‘another’][] = rand(0,10); // let’s do a var_dump array(4) { ["toto"]=> array(3) { [0]=> int(4) [1]=> int(5) [2]=> int(3) } ["titi"]=> ..

Read more

I’m struggling with an algorithmic problem how go transform or group data to get specified output. My input is a bunch of messages in given order (from newest to oldest): [ { "id":5, "created_at":"2021-01-01 00:00:00", "message":"Lorem ipsum dolor sit amet…", "is_author":true, "meta_data":{ } }, { "id":4, "created_at":"2021-01-01 01:00:00", "message":"Lorem ipsum dolor sit amet…", "is_author":true, "meta_data":{ ..

Read more

I have written a code for get subsets in array but this code uses much memory . i eager to know which procedure is better than this code? private function getSubsets($items) { $result = array(); $num = count($items); $members = pow(2, $num); for ($i = 0; $i < $members; $i++) { $b = sprintf("%0" . ..

Read more