
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 444 Articles for Programming Scripts

221 Views
To clear a chart from canvas, delete the element and then append a new element to the parent container as in the below-given code −var resetCanvas = function(){ $('#results-graph').remove(); $('#graph-container').append(''); canvas = document.querySelector('#results-graph'); ct = canvas.getContext('2d'); ct.canvas.width = $('#graph').width(); // here we are resizing the new canvas element to parent width ct.canvas.height = $('#graph').height(); // here we are resizing the new canvas element to parent height var a = canvas.width/2; var b = canvas.height/2; ct.font = '12pt Calibri'; ct.textAlign = 'Align Left'; ct.fillText('left aligned ... Read More

444 Views
For the browser to browser connection, follow the below-given steps −All the following library −Create a peer −For creating a peer, you need to get a free API key.var peer = new Peer('pick-an-id', {key: 'myapikey'});Connect −var conn = peer.connect('another-peers-id'); conn.on('open', function(){ conn.send('Welcome!'); });

1K+ Views
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

3K+ Views
Use the autofocus attribute to place the cursor in the text box when a page loads. The autofocus attribute is a Boolean attribute. When present, it specifies that an element should automatically get focus when the page loads. Here is an example −Example Name: Subject:

2K+ Views
The date picker in HTML5 shows a popup like a calendar. This is the same as selecting the months and years and this adds the date. Example: Style options for HTML date pickerYou can also customize the popup and add background color as well. You can try to run the following code to add style options for HTML date picker − ::-webkit-datetime-edit { padding: 4 em; } ::-webkit-datetime-edit-fields-wrapper { background:blue; } ::-webkit-datetime-edit-text { padding: 0 0.5em; } Editing a month, day and year field The following is to edit a month, day and year field − ::-webkit-datetime-edit-month-field { color: white; } ::-webkit-datetime-edit-day-field { color: red; } ::-webkit-datetime-edit-year-field { color: red; } ::-webkit-calendar-picker-indicator { background:gray; }

2K+ Views
For web page icon on iPhone or iPad, use the Apple Touch Icon or apple-touch-icon.png file. This icon is used when someone adds your web page as a bookmark.For multiple icons with different device resolutions like iPhone or iPad, add sizes attribute to each link element as follows −Set size The icon with the appropriate size for the device is used.

95 Views
As stated by w3.org −The autofocus attribute is a boolean attribute. The presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value.If the attribute is present, its value must either be the empty string or a value that is an ASCII case-insensitive match for the attribute's canonical name, with no leading or trailing whitespace.In HTML, use boolean attributes with or without values. For W3C, autofocus can be easily written autofocus or autofocus = "autofocus" or,autofocus = "".

2K+ Views
Convert videos to proper formats for HTML5 video on Linux shell using ffmpeg.When converting to an MP4, you want to use the h264 video codec and the aac audio codec because IE11 and earlier only support this combination. ffmpeg -i input.mov -vcodec h264 -acodecaac -strict -2 output.mp4In this example, input.mov is converted to output2.mp4 with maximum compatibility, with Quicktime support, and without an audio stream. ffmpeg -an -i input.mov -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -level 3 output2.mp4For Firefox compatible ogg video, ffmpeg2theora should be installed. Here the input file is output file from the ffmpeg conversion done before. ... Read More

154 Views
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

235 Views
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