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
/** | |
* Checks if the google.maps.Polygon.Path is inside the polygon. | |
* | |
* @see {@link https://developers.google.com/maps/documentation/javascript/overlays#Polygons} | |
* @see {@link http://gmaps-samples-v3.googlecode.com/svn/trunk/poly/pentagon.html} | |
* @see {@link http://debian.fmi.uni-sofia.bg/~sergei/cgsr/docs/clockwise.htm} | |
* @see {@link http://en.wikipedia.org/wiki/Curve_orientation} | |
* @param {google.maps.Polygon.Path} path | |
* @returns {boolean} | |
*/ |
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
/** | |
* Converts a color name to its corresponding hex string. | |
* | |
* @example getHexColor('orange') == '#ffa500' | |
* @param {String} colorValue The color name. | |
* @return {String} | |
*/ | |
var getColorNameFromHexColor = (function() { | |
var elem = document.createElement('div'); | |
var bg; |
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
/** | |
* HmacSHA512 | |
* | |
* @see <http://drumcoder.co.uk/blog/2011/apr/21/calculate-hmac-hash-java/> | |
* @param String value | |
* @param String secret | |
* @return String | |
*/ | |
private String buildHmacSignature(String value, String secret) { | |
String result; |
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
/** | |
* Conway Sequence | |
* | |
* @see http://en.wikipedia.org/wiki/Look-and-say_sequence | |
* @author Thiago Prates | |
*/ | |
public class ConwaySequence { | |
/** | |
* Generate a element at position n according to *Conway Sequence*. |
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
-- | |
-- Convert to decimal and change luminosity | |
-- Inspired by: http://www.sitepoint.com/javascript-generate-lighter-darker-color/ | |
-- | |
-- | |
-- Reverse: to_hex | |
-- See: http://grokbase.com/t/postgresql/pgsql-general/0541qyk9ya/help-with-converting-hexadecimal-to-decimal | |
CREATE OR REPLACE FUNCTION from_hex(t text) RETURNS integer AS $$ | |
DECLARE |
NewerOlder