Posts

Showing posts from November, 2019

How to config python3.6 interpreter in pycharm in ubuntu os

Image
How to config python3.6 interpreter in pycharm in ubuntu os Install pycharm education is free in ubuntu software store and after installing the pycharm to RUN the python file, we need to config python interpreter by pressing short cut ctrl + Alt  + s in keyword in pycharm will show configuration like screenshot below. pycharm python configuration Type interpreter in search box and select project interpreter  and select show all option in dropdown it will display pop up if you have configured then it will show configuration or it will show empty , if it as configured then select it  if it is not then click the plus + button ,which will give you option to select python version to select interpreter to run your project. select the python version and apply the changes ,then you will be able to run the pythpn file. Please share your comment below and any tips or tricks in python. Thank you

palindrome in python3.6 and php7

I am just practising, some interview question in both python and php to solve palindrome in easy way  to remember in interview.please share your solution or any latest interview question both php and python in comment box. PHP : $s =  'malayalam' ; $y =  '' ; for  ($i = strlen($s) -  1 ; $i >=  0 ; $i--) {     $y .= $s[$i]; } echo $y .  '</br>' ; if  ($s == $y) {     echo  "true" ; }  else  {     echo  "false" ; }

Increase the performance of yii2 project

Image
Increase the performance of yii2 project Recently, I was working on yii2 project with php 7.2 ,we were facing an issue on yii2 schema database ,in which we were using it yii2 as layer and was calling another yii2 API .At long run we were able to find that YII2 as some default rules in schema. Points: 1)  By default we are using active record ORM by YII2, So by default yii2 scans the database schema for every SQL query action. 2)To avoid it we used yii2 schema caching along with that ,we create CRON job to executes code from below link. https://forum.yiiframework.com/t/how-to-clear-schema-cache/35109/6 3) The CRON will refresh the schema of all tables and clear the cache. Please share your comments ,if there any other way to increase the performance of yii2. REFERAL: https://www.yiiframework.com/doc/guide/2.0/en/tutorial-performance-tuning#enable-schema-caching

yii2 arrayhelper::map vs array_map

Recently i was working on YII2 project in which i came across arrayhelper::map() and was thinking alternate in php. so i used array_map() also tested the performance of both in yii2 by start time and end time for both ,surprising was that execution time remain same.please let me know if there is any alternate that will execute faster then arrayhelper::map(). Adding the code in yii2: function find_field($value){ $value['id'] = $value['name']; return $value['id']; } $array = ['1'=>['id'=>1,'name' =>"pramodh",'address' =>'45 vk street','loc'=>'cbe'],'2'=>['id'=>2,'name' =>"pramodh kumar",'address' =>'45343 vk street','loc'=>'pune']]; $a = array_map(array($this,'find_field'),$array); print_r($a); yii2 code: $list = ArrayHelper::map($array,  ' id ' ,