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
FUNCTION DECSTR64 | |
PARAMETERS S | |
LOCAL i,j,j,k,q,ch,s2,buf,tmpc | |
tmpc = 0 | |
j = 0 | |
buf = 0 | |
s2 = '' | |
k = LEN(s) | |
FOR i = 1 TO k | |
ch = ASC(SUBSTR(s,i,1)) |
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
oRE = CreateObject("VBScript.RegExp") | |
oRE.Pattern = "regular expression here" | |
lcString = "string to search" | |
llResult = oRE.test(lcString) | |
lcMatches = oRE.Execute(lcString) | |
IF ALEN(lcMatches) > 0 | |
llResult = lcMatches(0).Submatches(0) && First match and first submatch/group | |
ENDIF |
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
*Example Usage: | |
CLEAR | |
Builder = CREATEOBJECT('HttpMessageBuilder') | |
*Builder.UserAgent = 'BK5' | |
Builder.AddHeader('TestHeader', 'test123 456') | |
Builder.AddHeader('TestHeader', 'test123 456') | |
Builder.AddParameter('TestParameter', 'Thisisat estparameter') | |
Builder.AddParameter('TestParameter', 'Thisisatestparam eter') | |
* You also get a free URLEncode function :) | |
Builder.URLEncode('str in g <3') |
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
unsigned short crc_16_rec(unsigned char * pucData, unsigned short ucLen) { | |
//-------------------------------------------------------------------- | |
unsigned int i; | |
unsigned char ucBit, ucCarry; | |
//-------------------------------------------------------------------- | |
unsigned short usPoly = 0x8408; //reversed 0x1021 | |
unsigned short usCRC = 0; | |
//-------------------------------------------------------------------- | |
for (i = 0; i < ucLen; i++) { | |
usCRC ^= pucData[i]; |
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
'use strict'; | |
var uuid = require('node-uuid'); | |
exports.action = { | |
name: 'securityApiKey', // Internal security action. Do not change the name. | |
description: 'I hand out api keys.', | |
version: 1.0, | |
inputs: { | |
uniqueId: { | |
required: true, | |
validator: function(param, connection, actionTemplate){ |
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 net = require('net'); | |
var tls = require('tls'); | |
var path = require('path'); | |
var protobuf = require('protocol-buffers'); | |
var initialize = function(api, options, next) { | |
var type = 'protobuf'; | |
var attributes = { | |
pendingShutdownWaitLimit: 5000, | |
schema: require('fs').readFileSync(path.join(__dirname, 'schema.proto')).toString() |
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
//Lets require/import the HTTP module | |
var http = require('http'); | |
//Lets define a port we want to listen to | |
const PORT=8080; | |
//We need a function which handles requests and send response | |
function handleRequest(request, response){ | |
response.end('It Works!! Path Hit: ' + request.url); | |
} |
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 s = require('net').Socket(); | |
s.connect(80, 'google.com'); | |
s.write('GET http://www.google.com/ HTTP/1.1\n\n'); | |
s.on('data', function(d){ | |
console.log(d.toString()); | |
}); | |
s.end(); |
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
CREATE OR REPLACE FUNCTION stored_get_data_history(SPGroupID integer, FromDate timestamp with time zone, ToDate timestamp with time zone) | |
RETURNS TABLE (device_id integer, "location" geometry, accuracy DOUBLE PRECISION, speed DOUBLE PRECISION, azimuth DOUBLE PRECISION, "createdAt" timestamp with time zone) LANGUAGE PLPGSQL AS $$ | |
BEGIN | |
RETURN QUERY SELECT | |
"Data".device_id, | |
"Data".location, | |
"Data".accuracy, | |
"Data".speed, | |
"Data".azimuth, | |
"Data"."createdAt" |
NewerOlder