Categories
Mastering Development

Python Pandas Problem Adding Rows with for loop

I wanted to add columns to a dataframe, with unique names. I tried to do that automatically with a for loop. I added an index after the name, but only the last value of i got displayed. I am relatively new to python and need help! Thanks! My Code: from urllib.request import urlopen import json […]

Categories
CMS Magento Mastering Development

I tried today to go to admin page and got this error

Warning: include(Mage/Admin/Model/Observer.php): failed to open stream: No such file or directory in /home/abogacec/public_html/dycgarage.ro/lib/Varien/Autoload.php on line 96 0 /home/abogacec/public_html/dycgarage.ro/lib/Varien/Autoload.php(96): mageCoreErrorHandler(2, ‘include(Mage/Ad…’, ‘/home/abogacec/…’, 96, Array) 1 /home/abogacec/public_html/dycgarage.ro/lib/Varien/Autoload.php(96): Varien_Autoload::autoload() 2 [internal function]: Varien_Autoload->autoload(‘Mage_Admin_Mode…’) 3 [internal function]: spl_autoload_call(‘Mage_Admin_Mode…’) 4 /home/abogacec/public_html/dycgarage.ro/app/code/core/Mage/Core/Model/Config.php(1346): class_exists(‘Mage_Admin_Mode…’) 5 /home/abogacec/public_html/dycgarage.ro/app/Mage.php(462): Mage_Core_Model_Config->getModelInstance(‘admin/observer’, Array) 6 /home/abogacec/public_html/dycgarage.ro/app/Mage.php(476): Mage::getModel(‘admin/observer’, Array) 7 /home/abogacec/public_html/dycgarage.ro/app/code/core/Mage/Core/Model/App.php(1316): Mage::getSingleton(‘admin/observer’) 8 /home/abogacec/public_html/dycgarage.ro/app/Mage.php(447): Mage_Core_Model_App->dispatchEvent(‘controller_acti…’, Array) 9 /home/abogacec/public_html/dycgarage.ro/app/code/core/Mage/Core/Controller/Varien/Action.php(528): Mage::dispatchEvent(‘controller_acti…’, […]

Categories
Mastering Development

Encrypt with CryptoJS in JavaScript gives me different results from Java encryption

I am trying to replicate with CryptoJS an encryption done in Java using another library. The encryption’s result in Java is [111,60,-98,107,-60,5,-17,91,-52,60,-105,64,-88,31,97,-102,118,-39,-28,3,70,-12,21,-69,70,-22,-12,-91,102,-21,-88,5,82,-66,-122,34,14,-115,7,82,-55,38,-90,74,-4,62,104,104,61,-78,57,59,-51,31,84,-115,-45,-98,-87,-11,53,98,45,2,-52] and I know that this is the correct payload. So, I am replicating the same encryption with the same values but I don’t get the same array of bytes. The steps are: I […]

Categories
Mastering Development

SQL query optimization using dynamic query

I have the following stored procedure. It uses a common table expression and a table valued function. It takes 600 ms to execute this sp. I used dynamic query to avoid the use of a table valued function and the the execution time reduced to around 300 ms. Is it possible to further tune this […]

Categories
Mastering Development

NodeJs encrypt using pbkdf2Sync and decrypt in java

I encrypt some data in NodeJs using below method. It works fine on Nodejs server to encrypt and decrypt. Input for encryption = “SIYdcYSyiWY5XUqYMrfv31sPF8DSojs1ikghMs4R” Encrypted Output in NodeJS = “IRhqmwhlFUxS1Zg+Qyr2ykSkAA1cQ5gVts7RIZoULCbYMS/DVsdfTyanGAAu4HkuAZv4ynk+VBPZ6vaTH5xTONfuVRlUavF9X//12v5et5em1ItPYdlOWkYo5IkodpAQvm5Yrm4F5xaRxRU3+TAZzOQm/3YQIlz74X+3V3/aV/K4qFebSLUMZJM9glPWo4O+ISDf76ztiN2ynLyvsivSU/qUuQEtPVEK” encryptAES = ((text) => { // random initialization vector const iv = crypto.randomBytes(16); const salt = crypto.randomBytes(64); var masterKey = crypto.randomBytes(32); const key = crypto.pbkdf2Sync(masterKey, […]

Categories
Ask Mathematics

Methods to approximate an inverse mean/average?

Edited for clarity. Assume I have a set of numbers X0 through Xk. Each number X is the average of n S values. S values are within some bounded range, for example [-1000 1000]. Is there an “intelligent” way to pick S values to obtain the given X values such that X = sum(S1…..Sn)/n Even […]

Categories
Mastering Development

print equally spaced elements of a 2D array with printf

I am trying to print a 2d array that has a maximum of 3 digit numbers that are aligned when printed. For example, with a simple printf, it looks like this: [0, 232, 20, 96, 176, 0, 0] [0, 0, 24, 0, 0, 176, 0] [0, 0, 0, 0, 0, 0, 0] I would like […]

Categories
CMS Development Magento

“Could not receive Stock Item data” Line Appear Instead of Admin Product Grid – Magento 2

“Could not receive Stock Item data” line appear instead of product grid in admin side. I have recently imported other db to my Cloud local setup. When I am doing indexing,I am getting error like this. SQLSTATE[HY000]: General error: 1449 The user specified as a definer (”@’%’) do es not exist, query was: DELETE price_index […]

Categories
Development

How contour an image area with known coordenates?

I have an ultrasound image and the coordenates (array of x and y points) of the tumour of each image. How can I make a contour around the tumour with those known coordenates using “cv.drawContours()”? I wish to delete all the information around the tumour and stay only with the tumour image/information. temp=np.array([[284., 60.],[276., 59.],[269., […]

Categories
Development Linux Ubuntu

Primary graphics card & multiple monitors with nouveau driver Ubuntu 18.04

The default Ubuntu 18.04 installation using the Nouveau driver lets the machine boot, and all three displays function. The machine has no onboard graphics and cannot boot without atleast one graphics card installed. The machine cannot boot past BIOS with only the Radeon card. The BIOS hangs with Intel error code 5A (resetting bus). With […]