Python is a high-level, interpreted, interactive and object-oriented scripting language. Python is designed to be highly readable. It uses English keywords frequently where as other languages use punctuation, and it has fewer syntactical constructions than other languages.Python is a MUST for students and working professionals to become a great Software Engineer specially when they are working in Web Development Domain. I will list down some of the key advantages of learning Python −Python is Interpreted − Python is processed at runtime by the interpreter. You do not need to compile your program before executing it. This is similar to PERL ... Read More
The canvas always scales from its current origin. The default origin is [0, 0]. If you want to scale from another point, you can first do ctx.translate(desiredX, desiredY);. This will reset the origin of the canvas to [desiredX, desiredY].The translate() method remaps the (0, 0) position on the canvas. The scale() method scales the current drawing, bigger or smaller. If you want to translate() the canvas context by your offset, you need to first scale() it to zoom in or out, and then translate() back by the opposite of the mouse offset.These steps are given in the following examplectx.translate(pt.x, pt.y); ... Read More
Facelets is an open-source Web template system for JavaServer Faces (JSF). The language requires valid input XML documents to work. Facelets supports all of the JSF UI components and focuses completely on building the JSF component tree, reflecting the view for a JSF application.Facelets is a XML based view technology. It cannot be used with HTML4 doctype. You can use with JSF/Facelets, even without a declaration in top of the page. Title Header Nav Main Footer
The elements of type date allows user to enter date, using a text box or using date picker. With the ng-model directive, bins the values of AngularJS application data to HTML input controls. Firefox does not currently support type="date". It will convert all the values to string. Sinceyou want date to be a real Date object and not a string, so we create another variable, and then link the two variables as done in the below given code function MainCtrl($scope, dateFilter) { $scope.date = new Date(); $scope.$watch('date', function (date){ $scope.dateString = dateFilter(date, 'yyyy-MM-dd'); ... Read More
Html2Canvas is a JavaScript library that can take screenshot of the whole web page or specific part. It doesn’t take the screenshot but creates the view based on the page information.ExampleBelow given is an example code. Here, html2canvas.js script is included at the . The html2canvas() method is called. Returns the base64 value, which eventually creates image source or an image file. Take screenshot function screenshot(){ html2canvas(document.body).then(function(canvas) { document.body.appendChild(canvas); }); }
For double buffering on the canvas, create a 2nd canvas element and draw to it. After that draw the image to the first canvas using the drawImage() method,// canvas element var canvas1 = document.getElementById('canvas'); var context1 = canvas1.getContext('2d'); // buffer canvas var canvas2 = document.createElement('canvas'); canvas2.width = 250; canvas2.height =250; var context2 = canvas2.getContext('2d'); // create on the canvas context2.beginPath(); context2.moveTo(10,10); context2.lineTo(10,30); context2.stroke(); //render the buffered canvas context1.drawImage(canvas2, 0, 0);
In the first example, you are just inheriting amitBaseClass prototype.function SomeClass() { } SomeClass.prototype = Object.create(amitBaseClass.prototype);In the second example, you are executing the constructor function. An instance of amitBaseClass is created and you are inheriting the who complete amitBaseClass object.function SomeClass () { } SomeClass.prototype = new amitBaseClass ();So, both are doing separate work.
To disable web browsers’ back button, try to run the following code. This is the code for current HTML page,Example Disable Browser Back Button Next Page $(document).ready(function() { function disablePrev() { window.history.forward() } window.onload = disablePrev(); window.onpageshow = function(evt) { if (evt.persisted) disableBack() } }); The following is the code for newpage.html, Go to back page using web browser back button. a
Automation is one of the hot domain in the Information and Technology, which has become predominant topic of discussion among the IT professionals. In general, automation can be defined as the process of involving software robots or hardware robots to solve the human problems (requirements). Due to this automation, it is said that ¼th of the job will be lost in the market. But people still prefer automation for (top) 7 reasons, which is discussed in this article.Cost SavingsCost is one of the major factor in the software development cycle, which predominantly comes into picture right from the planning phase. ... Read More
Fully self-driving cars may soon be a reality with Tesla cars. But Tesla still has a long way to completely set its autopilot suite of self-governing technologies in place. Autonomous driving refers to driving cars without the need of any human involvement. As of now, Tesla cars are semi-autonomous i.e. features that assist drivers on highways.The Tesla Autopilot SystemThe Tesla autopilot is a semi-autonomous system. It was rolled out in October 2014 in Tesla Model S cars. But it was only in 2015, that the Tesla Autopilot system (Tesla Version 7.0) rolled out. It allowed the car to adjust its ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP