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
public class OldPhone { | |
public static void main(String[] args) { | |
OldPhone phone = new OldPhone(); | |
System.out.println(phone.reverse_t9("999337777")); | |
} | |
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
public class Hoop { | |
public static void main(String[] args) { | |
Hoop hoop = new Hoop(); | |
int n = 3, m = 8; | |
int[] turns = new int[] {1, 2, 3, 4, 4, 0, 0, 0}; | |
int[] result = hoop.hoop(n, m, turns); | |
int i = 0; |
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> | |
<title>How To Use Lazy Repo</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script> | |
<script src="LazyRepo.js"></script> | |
</head> | |
<body> | |
<script type="text/javascript"> |
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
jkt.findLike( | |
"address", | |
"cilandak", | |
datasourcePusatBelanja, | |
function(results) { | |
if (results == null) { | |
console.log("Empty"); | |
return; | |
} | |
var len = results.rows.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
var jkt = new LazyRepo(databaseconfig); |
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 databaseconfig = { | |
name: 'dummydatabase', | |
version: '1.0', | |
realName: 'Dummy Database', | |
size: 2 * 1024 * 1024 | |
}; |
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 datasourcePusatBelanja = { | |
table: "pusatbelanja", | |
uri: "http://crop.jakarta.go.id/ajax/apps_command.php?Z2V0UGxhY2VtYXJrfjIwMTYwNTEwU200UlRDMXRZfkxTLTI=", | |
fields: ["placemark_id", "category_id", "user_id", "package_id", "name", "address", "description", | |
"lat", "lng", "created", "icon", "icon_placemark", "contact", "email", "website", "banner", | |
"twitter_account", "counter", "counterx", "marketing_by", "is_parent", "child_of", "display"] | |
} |
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
/** | |
* Copyright 2016 Amri Shodiq | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
// places should be array of object as a result from internet | |
function writeDatas(places) { | |
getDatabase().transaction(function(trx) { | |
createTableIfNotExists(trx, function() { | |
var religion = ""; | |
$.each(places, function(index, element) { | |
// parse the data and do insert to table | |
if (element.name.indexOf("MASJID")>=0 || element.name.indexOf("MUSALA")>=0) { | |
religion = "ISLAM"; | |
} else if (element.name.indexOf("GEREJA")>=0 || |
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
// after this function is executed, it will return true/false to callback | |
// callback should be a function that require a boolean parameter | |
function isDataExists(callback) { | |
getDatabase().transaction(function(trx) { | |
worship.createTableIfNotExists(trx, function() { | |
var sql = "SELECT * FROM worshipPlaces"; | |
console.log("Executing "+sql); | |
trx.executeSql(sql, null, function(trx, results) { | |
console.log("Results: "+results.rows.length); |
NewerOlder