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
package geolocation | |
import ( | |
"errors" | |
"github.com/json-iterator/go" | |
log "github.com/sirupsen/logrus" | |
"io" | |
"net/http" | |
"strconv" | |
"strings" |
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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
Intent intent = new Intent(ACTIVITY, Retrieve.java); | |
Item item = new Item(); | |
intent.putExtra("item", item); | |
startActivity(intent); |
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
Intent intent = this.getIntent(); | |
Bundle bundle = intent.getExtras(); | |
Item item = (Item)bundle.getSerializable("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
public class Item implements Serializable | |
{ | |
public List<String> ListString; | |
public 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
function palindrome($text) | |
{ | |
//memecah text menjadi sarang karakter | |
$text = str_split($text); | |
//tidak mengulang perhitungan diperulangan, memory wise | |
$count = count($text); | |
$palindrome = true; | |
//perulangan | |
for ($i = 0; $i < $count; $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
function anagram($needle, $haystack) | |
{ | |
$needle = trim($needle); | |
$haystack = trim($haystack); | |
if (!(strlen($needle) == strlen($haystack))) | |
return false; | |
$needle = unpack('C*', strtolower($needle)); | |
$haystack = unpack('C*', strtolower($haystack)); | |
rsort($needle); | |
rsort($haystack); |
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
package me.tegaralaga.utils; | |
import android.content.Context; | |
import android.graphics.Bitmap; | |
import android.support.v4.util.LruCache; | |
import com.android.volley.Request; | |
import com.android.volley.RequestQueue; | |
import com.android.volley.toolbox.ImageLoader; | |
import com.android.volley.toolbox.Volley; |
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.io.FileInputStream; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.util.Date; | |
import java.util.HashMap; | |
import java.util.Map; | |
import javax.servlet.http.HttpServletResponse; | |
import org.apache.poi.ss.usermodel.Cell; |
NewerOlder