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
<p> | |
<input id="ZzYYXq4fJie-GQY2lXrypjO-val" name="entryfield" title="GQY2lXrypjO - MCH Infant Weight (g) - undefined" value="[MCH Infant Weight (g)]" /> | |
</p> | |
<p id="bmi-text"> </p> | |
<script> | |
$(document).ready(function(){ | |
function setColor(color){ | |
$("p#bmi-text").css('background-color',color); |
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
import java.util.concurrent.Semaphore; | |
/** | |
* @author Chathura Widanage | |
*/ | |
public class Pizza { | |
private static volatile Semaphore pizzaPlate = new Semaphore(1); | |
private static volatile Semaphore delivery = new Semaphore(1); | |
private static volatile boolean orderInProgress = true;//order is in progress for first pizza | |
private static volatile int pizzas = 0;//no pizza initially |
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
for(i=0;i<n;i++){ | |
for(j=0;j<n;j++){ | |
for(k=0;k<n;k++){ | |
OUT[i][j]+=(A[i][k]*B[k][j]); | |
} | |
} | |
} |
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
$.get("http://dhis.pgim.cmb.ac.lk/nss/api/organisationUnits.json?fields=[id,level,name]&filter=level:eq:3").then(function(data){ | |
data.organisationUnits.forEach(function(ou){ | |
$.get("http://dhis.pgim.cmb.ac.lk/nss/api/enrollments.json?ou="+ou.id+"&ouMode=DESCENDANTS&totalPages=true&skipPaging=true&programStatus=ACTIVE&program=MmGml1Gyb7K").then(function(data){ | |
console.log(ou.name+":"+data.enrollments.length); | |
}) | |
}); | |
}); |
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
[default] | |
aws_access_key_id=<key> | |
aws_secret_access_key=<secret> |
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"?> | |
<Translation code="200" lang="en-fr"> | |
<text>Translated Text</text> | |
</Translation> |
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
MessageContext.Message.Payload = <English News Item> | |
MessageContext.ScopeVariables.lan = en-si |
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
MessageContext.Message.Payload = <Translated News Item> | |
MessageContext.ScopeVariables.lan = en-si | |
MessageContext.ScopeVariables.text = <Translated News Item> |
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
switch(messageContext.variables.lan){ | |
case "en-si": | |
publishToSinhalaTopic(messageContext.message.payload); | |
break; | |
case "en-ta": | |
publishToTamilTopic(messageContext.message.payload); | |
break; | |
case "en-fr": | |
publishToFrenchTopic(messageContext.message.payload); | |
break; |
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
let AWS = require('aws-sdk'); | |
const ddb = new AWS.DynamoDB.DocumentClient(); | |
exports.handler = function(event, context, callback) { | |
let now = new Date().getTime(); | |
ddb.put({ | |
TableName: 'contact_us', | |
Item: { | |
'name': event.name, | |
'email': event.email, | |
'phone': event.phone, |