This file contains 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 client = inbox.createConnection(config); | |
client.on('connect', function () { | |
client.openMailbox('INBOX', function (err, info) { | |
if (err) { | |
console.error('Box open error', err); | |
} else { | |
console.log('Message count in INBOX : ' + info.count); | |
client.listMessages(0, 1, function (err, messages) { | |
if (err) { | |
console.error('Message Listing error', err); |
This file contains 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
<cfscript> | |
try { | |
throw( | |
message="MyError", | |
errorcode="100", | |
detail="Error Detail" | |
); | |
} catch (any e) { | |
writeOutput("Caught Exception: " & e.message & " with errror code: " & e.errorcode & " and detail: " & e.detail); | |
} |
This file contains 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
const MILES2METER = 1609.34; | |
const METER2MILE = 0.000621371; | |
// JavaScript program to check circles overlapping | |
function circle(x1, y1, x2, y2, r1, r2) { | |
//let distSq = Math.sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2))); | |
let distSq = getDistanceFromLatLonInMile(x1, y1, x2, y2) * MILES2METER; | |
if ( r1 < r2 ) { | |
[r1,r2]=[r2,r1]; | |
} |
This file contains 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
//reference https://en.wikipedia.org/wiki/Lens_(geometry) | |
function findDelta (d, r, R) { | |
return (1 / 4) * Math.sqrt((-d + r + R) * (d - r + R) * (d + r - R) * (d + r + R) ); | |
} | |
function area (d, r, R) { | |
const delta = findDelta(d, r, R); | |
const cosLeft = (Math.acos(((d * d) + (r * r) - (R * R)) / (2 * d * r))); | |
const cosRight = (Math.acos(((d * d) - (r * r) + (R * R)) / (2 * d * R))); |
This file contains 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
<cfscript> | |
myarray = ["one","two","three","TWO","five","Two"]; | |
res = myarray.slice(5,10); | |
writedump(res); | |
</cfscript> |
This file contains 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> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<script src="https://code.jquery.com/jquery-3.1.0.js"></script> | |
<script src="https://cdn.jsdelivr.net/lodash/4/lodash.min.js"></script> | |
<title>Filters</title> | |
<style> |
This file contains 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
<cfset contractorArray = ["Vikas", "Bharat", "Pritesh", "Ashish"] /> | |
<cfset serviceArray = ["Lawncare", "Snow removal", "Winterization", "Occupancy Check"] /> | |
<cfset jobArray = [ | |
{ "jobNo": "J8235-62", "contractor": "Vikas", "services": ["Lawncare", "Snow removal"] }, | |
{ "jobNo": "J8235-63", "contractor": "Bharat", "services": ["Snow removal", "Winterization"] }, | |
{ "jobNo": "J8235-64", "contractor": "Bharat", "services": ["Lawncare", "Snow removal", "Winterization"] }, | |
{ "jobNo": "J8235-65", "contractor": "Pritesh", "services": ["Winterization", "Occupancy Check"] }, | |
{ "jobNo": "J8235-66", "contractor": "Vikas", "services": ["Snow removal"] }, |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<shiporder orderid="889923" | |
xmlns="http://webservice.example.com/" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://webservice.example.com/ https://gist.githubusercontent.com/vikaskanani/016522bc8969008e5efdf6770effc430/raw/5eec95f8eb34c538f1cfd1e543b22027e021eafa/ShipOrder.xsd"> | |
<orderperson>John Smith</orderperson> | |
<shipto> | |
<name>Ola Nordmann</name> | |
<address>Langgt 23</address> | |
<city>4000 Stavanger</city> |
This file contains 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
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
-- ============================================= | |
-- Author: Vikas Patel | |
-- Create date: 01/31/2019 | |
-- Description: Remove leading zeros from string | |
-- ============================================= | |
CREATE FUNCTION dbo.funRemoveLeadingZeros |
This file contains 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
<cfsavecontent variable="xml_stream"><cfoutput><?xml version="1.0" encoding="UTF-8"?> | |
<shiporder orderid="889923" | |
xmlns="http://webservice.example.com/" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://webservice.example.com/ https://gist.githubusercontent.com/vikaskanani/016522bc8969008e5efdf6770effc430/raw/5eec95f8eb34c538f1cfd1e543b22027e021eafa/ShipOrder.xsd"> | |
<orderperson>John Smith</orderperson> | |
<shipto> | |
<name>Ola Nordmann</name> | |
<address>Langgt 23</address> | |
<city>4000 Stavanger</city> |
NewerOlder