Skip to main content

Posts

Introduction Phyton3

Why Phyton: There is some points to choose phyton, 1 - Free & open source: , It's high Level language 2 - portable & extensible: (Write once run in any platform or windows) , extensivility means you can integrate the java , asp.net , C, C++ libraries component into the python 3 - Web development :  Python has great frameworks to develop web like ( django,flask,pylons,web2py ) 4 - Artificial Intelligence & Machine learning: AI is the next future development of tech world, Python fully support the AI program and features, AI provides some libraries which is helpful the develop this type of features. like below scikit learn  (for complex calculations) keras & tensorflow ( for machine learning ) opencv (for image/face recognition and hndwriting etc) 5- Computer Graphics : Python can develop the GUI, desktop application,game application , To do this type of applications , It has some libraries like below Tkinter ( for GUI) jython ( for python s...

How to Pass js Variable from php to Js, By drupal settings

Create the module.libraries.yml at-story: js: js/at-story.js: {} dependencies: - core/jquery - core/jquery.once - core/drupalSettings File : at-story.js Drupal.behaviors.atjs = { attach: function (context, drupalSettings) { if (drupalSettings.at_story.node_published == false) {//not published if (drupalSettings.at_story.node_type == 'story') { $('#edit-title-0-value', context).keyup(function () { var long_h = $(this).val(); $('#edit-field-story-short-headline-0-value').val(long_h); $('#edit-field-app-headline-0-value').val(long_h); }); } } } }; module file where we load the file and varibales : .module file if($form_id == 'node_story_edit_form' || $form_id == 'node_video_edit_form' || $form_id == 'node_photo_gallery_edit_form...

OOPS in PHP part I

Static Methods and Properties: Static Methods and Properties is very useful feature in PHP and in this post i am going to tell you about Static Methods and Properties in PHP with example. If you declare any class property or methods as static then you don't need to create object of class to access that means it can be accessible without creating object of class. You can access directly from class with the help of scope resolution operator (::). You can use  static  keyword to define static methods and properties. class myClass { static public $variable1 = 5; static public $variable2 = 2; static public function getSum() { $sum=self::$variable1+self::$variable2; print "Sum of two variables is " . $sum; } } echo myClass::$variable1; myClass::getSum(); If you extends the parent class in child class and want to access parent class property then you can use parent keyword. parent::$variable1 Why use static methods and proper...