This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Dependencies: Apache POI Library from http://poi.apache.org/ | |
*/ | |
package poi_excels; | |
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.util.logging.Level; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Dependency: Office 2007 | |
* OR | |
* Install 2007 Office System Driver - Data Connectivity Components from http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7554F536-8C28-4598-9B72-EF94E038C891&displaylang=en | |
* No references or anything needed to be added. | |
* | |
* Other Notes: | |
* 1. There is a 64-bit version too. But I am using the 32-bit one. | |
* 2. For Office 2010. there is a 'Microsoft Access Database Engine 2010 Redistributable' at http://www.microsoft.com/downloads/en/details.aspx?FamilyID=C06B8369-60DD-4B64-A44B-84B371EDE16D | |
* 3. I am Using OLEDB here. ODBC can also be used. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Dependency : Excel Data Reader from http://exceldatareader.codeplex.com/ | |
* You must add the references to the Dlls (downloaded from the link above) with Visual Studio. | |
*/ | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using Excel; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript"> | |
/* | |
This code is a IE8 (and below), polyfill for HTML5 Range object's startContainer, | |
startOffset, endContainer and endOffset properties. | |
*/ | |
(function () { | |
function findTextNode(node, text) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function selectionPolyfill(window, document) { | |
if (window.getSelection || !document.selection) return; | |
// convert an IE TextRange to a W3C one | |
function convert(range, startOrEnd) { | |
var point = range.duplicate() | |
, result = {}; | |
// point is either the start or end of the range | |
point.collapse(startOrEnd); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<!-- HBox and VBox layouts have been implementated with many libraries/toolkits on | |
different platforms and languages (like ExtJS,QT,GTK,.NET...). | |
This tries to achieve the same but with CSS only. | |
Supported browsers: IE 10+, Safari 6.1, Latest FF, Chrome --> | |
<style type="text/css"> | |
html, body { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Taken from http://stackoverflow.com/a/13558570. | |
* aka inverse gamma. Some call it "inverse sRGB companding". | |
* All the constants are taken from sRGB spec. | |
* Read about it at http://en.wikipedia.org/wiki/SRGB (I didn't understand how they derived the approximation). | |
*/ | |
function linear(R) { //in sRGB as hex string | |
var s = parseInt(R, 16) / 255; | |
if (s <= 0.04045) { | |
return s / 12.92; | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Detect unsafe (and potentially unsafe) unbalanced tags in a given HTML snippet. | |
* Hints taken from an html parse (https://gist.github.com/cburgmer/2877758). | |
* | |
* Example: | |
* An unclosed div tag is considered unsafe, because if the snippet is pasted in between two div tags | |
* then it could end up breaking the HTML document. | |
* Self closing tags (tags that you can intentioanlly leave open like <table><tr><td>some text</table>) are also considered unsafe, for the same reason. | |
* However an unclosed void tag (like meta tag) is safe, because browsers will ignore it without any side effects. | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* jQuery 2.1.3's parseHTML (without scripts options). | |
* Unlike jQuery, this returns a DocumentFragment, which is more convenient to insert into DOM. | |
* MIT license. | |
* | |
* If you only support Edge 13+ then try this: | |
function parseHTML(html, context) { | |
var t = (context || document).createElement('template'); | |
t.innerHTML = html; | |
return t.content; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<script> | |
/** | |
* The problem: Binding functions (using function.bind()) and adding listeners is messy, | |
* since a bind creates a new function everytime and one needs to keep reference to the new function. | |
* When having many event handlers this gets messy. | |
* |
OlderNewer