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
/** | |
* Retrofit adapter builder | |
* Created by moltak on 2014. 7. 9.. | |
*/ | |
public class LMNetworkBuilder { | |
public static RestAdapter getAdapter() { | |
return getBuilder().build(); | |
} | |
public static RestAdapter.Builder getBuilder() { |
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
package com.day1song.app.tools; | |
import android.content.Context; | |
import android.content.pm.PackageInfo; | |
import android.content.pm.PackageManager; | |
import android.net.wifi.WifiInfo; | |
import android.net.wifi.WifiManager; | |
import android.os.Build; | |
import android.provider.Settings; | |
import android.telephony.PhoneStateListener; |
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
#!/bin/bash | |
import simplejson, urllib2 | |
BASE_URL = "http://apis.daum.net/local/geo/coord2addr?" \ | |
"apikey=DAUM_LOCAL_DEMO_APIKEY&latitude={0}&longitude={1}&output=json&inputCoordSystem=WGS84" | |
def get_address(lat, lng): | |
global BASE_URL |
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
package com.limo.limo_passenger.rest.google.place.service; | |
import com.limo.limo_passenger.rest.google.place.model.PlaceSearchResponse; | |
import com.limo.limo_passenger.rest.google.place.PlaceApiRetrofitAdapterBuilder; | |
import com.limo.limo_passenger.rest.limo.LMCallback; | |
import com.limo.limo_passenger.rest.limo.LMNetworkBus; | |
import retrofit.RestAdapter; | |
import retrofit.client.Response; | |
import retrofit.http.GET; |
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
buildscript { | |
repositories { | |
maven { | |
url "https://plugins.gradle.org/m2/" | |
} | |
} | |
dependencies { | |
classpath "net.ltgt.gradle:gradle-apt-plugin:0.3" | |
} | |
} |
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
[alias] | |
graph = log --graph --date-order -C -M --pretty=format:\"%C(blue)%h%C(reset) (%ar) [%an] %C(yellow)%d%Creset %s\" --all --date=short | |
l = !git graph | less -FXRS | |
h = !git graph -1 | less -FXRS | |
ls = log --graph -C -M --pretty=format:"%C(yellow)%h%Cgreen%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --all --date=short | |
ll = log --pretty=format:"%C(yellow)%h%Cgreen%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --all --numstat | |
b = branch | |
c = commit | |
cc = commit -a | |
co = checkout |
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
/** | |
* Matcher that is Toast window. | |
*/ | |
public static Matcher<Root> isToast() { | |
return new TypeSafeMatcher<Root>() { | |
@Override | |
public void describeTo(Description description) { | |
description.appendText("is toast"); | |
} |
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 class HttpImageTagExtractor { | |
public static List<String> extract(String text) { | |
//regular expression for extract image tag | |
Pattern pattern = Pattern.compile("<img[^>]*src=[\"']?([^>\"']+)[\"']?[^>]*>"); | |
Matcher matcher = pattern.matcher(text); | |
List<String> lists = new ArrayList<>(); | |
while(matcher.find()) { | |
lists.add(matcher.group(1)); | |
} |
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
def createFormula(K, list, i): | |
formula = [0 for _ in range(K)] | |
for i in range(K): | |
formula[i] = list[0] | |
formula[K - 1] = 0 | |
return formula | |
def calc(list, formula, permutation, i): |
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
import solve | |
def test_first(): | |
arg = [] | |
arg.append((1, 3)) | |
arg.append([3]) | |
result = solve.kSums(arg) | |
assert result[0] == 1 |