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
#include <stdio.h> | |
int nextprime(int number); | |
int isprime(int value); | |
int main(void) | |
{ | |
// let size of each choc. be 50 grm | |
long int chocw=50; | |
long int expectedw=0; | |
long int resultw=0; |
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 bubbleSort (sortingArray) { | |
var goto = sortingArray.length - 1; | |
for(var key in sortingArray) { | |
for(var i = 0; i <= goto - 1; i++) { | |
if(sortingArray[i] > sortingArray[i + 1]) { | |
// Swap | |
var temp = sortingArray[i]; | |
sortingArray[i] = sortingArray[i +1]; | |
sortingArray[i + 1] = temp; | |
} |
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 BKSPKEY = 8; | |
handleCommandDelete = function(event,component){ | |
var messageBox = $(component); | |
var valueText = messageBox.val(); | |
//get current cursor position | |
if(event.keyCode != BKSPKEY){ | |
return true; | |
} |
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 closureParentFunction(){ | |
var localVar = 0; | |
var localFunction = function(){ | |
console.log('localVar=',++localVar); | |
} | |
setInterval(localFunction,2000); |
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
public static List<Sobject> sort(List<Sobject> sourceList,String fieldName){ | |
List<Sobject> sortedList = new List<Sobject>(); | |
List<SObjectWrapper> wrapperList = new List<SObjectWrapper>(); | |
for(Sobject object : sourceList){ | |
SObjectWrapper wrapperObject = new SObjectWrapper(object,fieldName); | |
wrapperList.add(wrapperObject); |
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 credential = ' OAuth ' + "<session id of target org >"; // native VF function | |
var apiUrl = "https://ap1.salesforce.com/services/data/v26.0/chatter/users/me"; | |
$.ajax({ | |
type: "GET", | |
// for community pages, use whole community url including path, e.g. | |
// https://logan.blitz01.t.force.com/customers/services/proxy. | |
url: "https://na9.salesforce.com/services/proxy", | |
contentType: 'application/json', | |
cache: false, | |
success : function(response) { |
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 util = util || {}; | |
util.getKeys = function (obj) { | |
var r = [] | |
for (var k in obj) { | |
if (!obj.hasOwnProperty(k)) | |
continue | |
r.push(k) | |
} | |
return r; |
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
//Developed by Swapnil Shrikhande | |
//USAGE | |
//utils.sort.mergesort([8, 5, 3, 53, 6, 2, 4, 9, 445, 689, 2774, 328, 193, 482],[comparator_function]); | |
var utils = utils || {}; | |
utils.sort = utils.sort || {}; | |
utils.sort.mergesort = function(list, comparator) { | |
if (list.length == 1) { | |
return list; | |
} |
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
//Developed by Swapnil Shrikhande | |
//USAGE | |
//utils.sort.mergesort([8, 5, 3, 53, 6, 2, 4, 9, 445, 689, 2774, 328, 193, 482],[comparator_function]); | |
var utils = utils || {}; | |
utils.sort = utils.sort || {}; | |
utils.sort.mergesort = function(list, comparator) { | |
if (list.length == 1) { | |
return list; | |
} |
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
if(typeof JSON!=="object"){JSON={}}(function(){"use strict";function f(e){return e<10?"0"+e:e}function quote(e){escapable.lastIndex=0;return escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return typeof t==="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,i,s,o=gap,u,a=t[e];if(a&&typeof a==="object"&&typeof a.toJSON==="function"){a=a.toJSON(e)}if(typeof rep==="function"){a=rep.call(t,e,a)}switch(typeof a){case"string":return quote(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a){return"null"}gap+=indent;u=[];if(Object.prototype.toString.apply(a)==="[object Array]"){s=a.length;for(n=0;n<s;n+=1){u[n]=str(n,a)||"null"}i=u.length===0?"[]":gap?"[\n"+gap+u.join(",\n"+gap)+"\n"+o+"]":"["+u.join(",")+"]";gap=o;return i}if(rep&&typeof rep==="object"){s=rep.length;for(n=0;n<s;n+=1){if(typeof rep[n]==="string"){r=rep[n];i=str(r,a);if(i){u.push(quote(r)+(gap?": ":":")+i)}}}}else{f |