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> | |
<body> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/pako/2.0.3/pako.min.js"></script> | |
<script> | |
// Training set | |
const trainingSet = [ | |
["How can I create a new project?", "To create a new project, go to the dashboard and click on 'New Project'. Then, fill out the details and click 'Save'."], | |
["How can I invite team members to my project?", "To invite team members to your project, open the project and click on 'Invite Members'. Enter their email addresses and click 'Send Invites'."], | |
["Can I assign tasks to team members?", "Yes, you can assign tasks to team members. To do this, create a new task and select a team member from the 'Assign To' dropdown."], |
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
// bitmap is a photo take from camera, assets or gallery, | |
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); | |
bitmap.compress(Bitmap.CompressFormat.JPEG, 92, byteArrayOutputStream); | |
byte[] byteArray = byteArrayOutputStream.toByteArray(); | |
String b64 = Base64.encodeToString(byteArray, Base64.DEFAULT); | |
JSONObject json = new JSONObject(); | |
try { | |
json.put("img0", b64); | |
// repeat as necessary, at least 5 |
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
private var ids = ArrayList<Long>() | |
fun getIds(results : Any) : ArrayList<Long> { | |
var ids = ArrayList<Long>() | |
for (result in results) { | |
ids.add(result.id) | |
} | |
return ids | |
} |