Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Programming Scripts Articles
Page 25 of 33
How to create a process in Linux?
A program loaded into memory and executing is called a process. In simple, a process is a program in execution.Let’s inspect how to create a process in LinuxA new process can be created by the fork() system call. The new process consists of a copy of the address space of the original process. fork() creates new process from existing process. Existing process is called the parent process and the process is created newly is called child process. The function is called from parent process. Both the parent and the child processes continue execution at the instruction after the fork(), the ...
Read MoreDetect compatibility of the new HTML5 tag <mark> with jQuery.
Use the following to check the compatibility of the HTML5 tag :var $myEL = $(''); $myEL.appendTo('body'); var bgColor = $myEL.css('backgroundColor'); if (/rgb\(255\, 255\, 0\)/.test(bgColor)) return true; else return false;
Read MoreMake HTML5 Canvas fill the whole page
To make canvas fill the whole page, you need to be 100% in width and height of the page.* { margin: 0; padding: 0; } body, html { height:100%; } #canvas { position:absolute; height:100%; width:100%; }
Read MoreHTML5 Cross Browser iframe post message - child to parent?
The parent object provides a reference to the main window from the child.The following is the parent code. The directive below triggers the iFrame to send a message to the parent window every 3 seconds. No initial message from the main window needed!var a= window.addEventListener ? "addEventListener" : "attachEvent";// here a is the event method var b= window[a];// here b is the eventer var c= a== "attachEvent" ? "onmessage" : "message";// here c is the message event // Listen to message from child window b (c, function(e) { var d= e.message ? "message" : "data";// here d is ...
Read MoreZoom HTML5 Canvas to Mouse Cursor
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 MoreAngularJS and HTML5 date input value - how to get Firefox to show a readable date value in a date input?
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 MoreCan you take a screenshot of the page using HTML5 Canvas?
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); }); }
Read MoreDoes HTML5 Canvas support Double Buffering?
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);
Read MoreHow To Install Parse Server on Ubuntu
Parse server is an open source and is like mobile back-end. It is owned by Facebook since 2013. This server may be deployed to any infrastructure that may run Node.Js and MongoDB. This article explains about – How To Install Parse Server on Ubuntu.Prerequisitespython-software-properties packageNode.jsMongoDBTo add python-software-properties package, use the following command-$ sudo apt-get install build-essential git python-software-propertiesThe sample output should be like this –Reading package lists... Done Building dependency tree Reading state information... Done build-essential is already the newest version (12.1ubuntu2). build-essential set to manually installed. The following packages were automatically installed and are no longer required: linux-headers-4.4.0-31 ...
Read MoreTechnologies Commonly Used by Startups
As you decide on the factors affecting your choices, you can now narrow down from the technology options available to a controllable set. It is imperative for startups to take on best practices along with choosing the right technology (tech.) stacks for their business to grow.Typical Tech StackApplications have two ends – the front-end (client side) and the back-end (server side). For eg. on the server side, the applications could be the operating system, the web server, database, programming language and the web framework. These are stacked one on the top of the other with the web framework at the ...
Read More