- You have no rights
- Please read carefully 1
Last updated November 1st, 2012.
| #include <stdio.h> | |
| main(){ | |
| int i, sumOfSquares = 0, squareOfSum, sum = 0; | |
| for(i = 1; i <= 100; i++){ | |
| sumOfSquares += i * i; | |
| sum += i; | |
| } | |
| squareOfSum = sum * sum; | |
| printf("%d\n", squareOfSum - sumOfSquares); |
| /* | |
| █░░░░░█░░░░░░░░░░░░░░░░░░░░░█░░█░░░░░░░░░░░░░░█▀▀█ | |
| █░█▀█░█░░█░█░░█▀█▀█░█▀▀█░█▀▀█░░█▀▀█░█▀▀░█▀▀▀█░░░░█ | |
| █░█░█░█░░█░█░░█░█░█░█▀▀█░█░░█░░█░░█░█░░░█░░░█░░▀▀▀ | |
| ▀░▀▀▀░▀░░▀▀▀░░▀░░░▀░▀░░▀░▀▀▀▀░░▀▀▀▀░▀░░░▀▀▀▀▀░░█░░ | |
| */ |
| /* | |
| * node-ws - pure Javascript WebSockets server | |
| * Copyright Bradley Wright <[email protected]> | |
| */ | |
| // Use strict compilation rules - we're not animals | |
| 'use strict'; | |
| var net = require('net'), | |
| crypto = require('crypto'); |
| //creating an element is easy peasy | |
| var divElem = document.createElement( 'div' ); | |
| //divElem is now a div element. it's not related to the any other element or | |
| // node, it's free-range. | |
| //to add it to the body element, for example: | |
| document.body.appendChild( divElem ); | |
| //splendidsimo! |
| 1. Zirak likes babies. |
| var button = document.createElement('button'); | |
| button.className = 'button'; | |
| button.appendChild(document.createTextNode('Google')); | |
| button.addEventListener('click', function (){ | |
| window.open('https://www.google.com/search?q=' + document.getElementById('input').value); | |
| }, false); | |
| document.getElementById('sayit-button').insertAdjacentElement('afterend', button); |
| NodeList.prototype.forEach = HTMLCollection.prototype.forEach = Array.prototype.forEach; | |
| NodeList.prototype.map = HTMLCollection.prototype.map = Array.prototype.map; | |
| NodeList.prototype.filter = HTMLCollection.prototype.filter = Array.prototype.filter; | |
| NodeList.prototype.reduce = HTMLCollection.prototype.reduce = Array.prototype.reduce; | |
| NodeList.prototype.every = HTMLCollection.prototype.every = Array.prototype.every; | |
| NodeList.prototype.some = HTMLCollection.prototype.some = Array.prototype.some; | |
| var By = { | |
| id: function (id) { return document.getElementById(id) }, | |
| tag: function (tag, context) { | |
| return (context || document).getElementsByTagName(tag) |
| <center class="centerizer"> | |
| <p>Switch Awesomness on!</p> | |
| <span> | |
| <input id="toggle" type="checkbox" /> | |
| <label for="toggle" > | |
| <div class="On">On</div> | |
| <div class="Off">Off</div> | |
| </label> | |
| </span> | |
| <canvas id='test' width='400' height='400'></canvas> | |
| <script> | |
| var img = new Image(); | |
| img.src = 'http://fc01.deviantart.net/fs70/f/2012/187/b/b/ben_10__my_sprite_sheet_by_pyroman16-d56744g.png'; | |
| var ctx = document.getElementById('test').getContext('2d'); | |
| img.onload = function() { | |
| ctx.drawImage(img, 0, 0, 300, 300, 0, 0, 300, 300); | |
| }; |