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
Telnet-like connections for SSL. | |
openssl s_client -connect hostname:port |
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
https://github.com/sqs/rhino/ |
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
/** | |
Via: Stack Overflow | |
Originally from: | |
http://stackoverflow.com/questions/1032721/does-anybody-know-what-encrypting-technique-is-jdeveloper-sql-developer-using-to | |
Developed by: Adam Paynter (http://stackoverflow.com/users/41619/adam-paynter) | |
*/ | |
import javax.crypto.*; |
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
GeoName.find_by_sql("SELECT ordered.* FROM (SELECT gn.*, round(distance.d * 6371.0, 2) AS distance_km, round(distance.d * 6371.0 * 0.621371192, 2) as distance_miles FROM | |
(SELECT (2*atan2(sqrt(calcs.a), sqrt(1-calcs.a)))::numeric d, calcs.id FROM | |
(SELECT (sin(consts.dlat/2) * sin(consts.dlat/2) + sin(consts.dlon/2) * sin(consts.dlon/2) * cos(consts.lat1) * cos(consts.lat2)) as a, consts.id FROM | |
(SELECT f.id, abs((#{self.exif_data.latitude} - f.latitude)*(#{Math::PI}/180)) AS dlat, | |
abs((#{self.exif_data.longitude} - f.longitude)*(#{Math::PI}/180)) AS dlon, | |
#{self.exif_data.latitude} * (#{Math::PI}/180) as lat1, | |
f.latitude * (#{Math::PI}/180) as lat2 FROM geo_names f) consts) calcs) distance, | |
geo_names gn WHERE gn.id = distance.id ORDER BY distance.d ASC LIMIT 10) ordered ORDER BY random() LIMIT 1") |
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
GeoHelper.IsInPolygon=function(points,latlong) | |
{ | |
// This code adapted from the following URL: | |
// http://msdn.microsoft.com/en-us/library/cc451895.aspx | |
var i; | |
var j=points.length-1; | |
var inPoly=false; | |
var lat = latlong.Latitude; | |
var lon = latlong.Longitude; | |
for (i=0; i<points.length; i++) |
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
var R = 6371; // km | |
var dLat = (lat2-lat1).toRad(); | |
var dLon = (lon2-lon1).toRad(); | |
var lat1 = lat1.toRad(); | |
var lat2 = lat2.toRad(); | |
var a = Math.sin(dLat/2) * Math.sin(dLat/2) + | |
Math.sin(dLon/2) * Math.sin(dLon/2) * Math.cos(lat1) * Math.cos(lat2); | |
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); | |
var d = R * c; |
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
Format meaning: | |
%a - The abbreviated weekday name (``Sun'') | |
%A - The full weekday name (``Sunday'') | |
%b - The abbreviated month name (``Jan'') | |
%B - The full month name (``January'') | |
%c - The preferred local date and time representation | |
%d - Day of the month (01..31) | |
%H - Hour of the day, 24-hour clock (00..23) | |
%I - Hour of the day, 12-hour clock (01..12) |
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
<html> | |
<head> | |
<title>Convert Between Geographic and UTM Coordinates</title> | |
<script type="text/JavaScript" src="../jsDraw2D.js"></script> | |
<link rel="stylesheet" type="text/css" href="../main0.css"> | |
<script language=javascript> | |
function Declarations(){ | |
//Symbols as used in USGS PP 1395: Map Projections - A Working Manual |
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
import org.apache.poi.hssf.usermodel.HSSFCellStyle; | |
import org.apache.poi.hssf.usermodel.HSSFRichTextString; | |
import org.apache.poi.hssf.usermodel.HSSFWorkbook; | |
import org.apache.poi.ss.usermodel.Cell; | |
import org.apache.poi.ss.usermodel.Font; | |
import org.apache.poi.ss.usermodel.Row; | |
import org.apache.poi.ss.usermodel.Sheet; | |
import org.apache.poi.ss.usermodel.Workbook; | |
import org.apache.poi.ss.util.CellRangeAddress; |
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
case @data | |
when "GrayScale" | |
colorSpace = CS.getInstance(CS::CS_GRAY) | |
op = java.awt.image.ColorConvertOp.new(colorSpace, nil) | |
when "Negative" | |
lut = Array.new | |
for j in 0..255 | |
lut[j] = 256-j | |
end | |
jlut = lut.to_java :byte |