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
// MMGClient *client = ... | |
MMGObject *registerUserObj = [client registerUserWithId:@"baabaa" | |
name:@"Baa Baa Black Sheep" | |
email:@"[email protected]" | |
password:@"moomoo" | |
delegate:nil]; | |
if (registerUserObj.error != nil || registerUserObj.type != kMMGUser) { | |
NSLog(@"ユーザー登録のエラーが発生しました: %@", [registerUserObj.error localizedDescription]); |
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
// MMGClient *client = ... | |
// ユーザーIDはサーバーで既に登録されるか確認する。 | |
// デリゲートがnilすると、同期してリクエストをする。 | |
MMGObject *checkUserObj = [client checkAvailabilityOfUserId:@"baabaablacksheep" withDelegate:nil]; | |
if (checkUserObj.error != nil || checkUserObj.type != kMMGUser) { | |
NSLog(@"ユーザー確認のエラーが発生しました: %@", [checkUserObj.error localizedDescription]); | |
} else { | |
// タイプはkMMGUserの場合は、安全にMMGUserにキャストできる。 |
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 "MMGClient.h" | |
// アプリケーションのデリゲート。Geomonにログインするため、MMGRequestDelegateのプロトコルが実装される。 | |
@interface AppDelegate : UIResponder <UIApplicationDelegate, UITabBarControllerDelegate, MMGRequestDelegate> | |
// 他のプロパティの定義... | |
// Geomonのクライアントオブジェクト | |
@property (strong, nonatomic) MMGClient *client; |
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 static final String REGEX_TIMERANGE = "(?:AM|PM)?([0-90-9]{1,2})[::\\.]([0-90-9]{1,2})[\uff5e\u301c-―-](?:AM|PM)?([0-90-9]{1,2})[::\\.]([0-90-9]{1,2})"; | |
public static final Pattern PATTERN_TIMERANGE = Pattern.compile(REGEX_TIMERANGE); |
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 static final String SPACE = "[\\s\u3000]"; | |
public static final String NUMBER = "[0-9\uff10-\uff19]"; // 0-90-9 | |
public static final String HYPHEN = "[-\uff0d\u2212]"; | |
public static final String NOT_NUMBER_OR_HYPHEN = "[^" + NUMBER.substring(1, NUMBER.length()-1) + HYPHEN.substring(1); | |
public static final String SEPARATOR = "[\\(\\)" + HYPHEN.substring(1, HYPHEN.length()-1) + "]"; | |
public static final String REGEX_PHONEFAX = | |
"(?:" + NOT_NUMBER_OR_HYPHEN + "|^)" + | |
SPACE + "*(" + NUMBER + "{2,4})" + | |
SPACE + "*" + SEPARATOR + |
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 static String toHankakuNumbers(String zenkaku) { | |
if (zenkaku == null) | |
return null; | |
StringBuffer ret = new StringBuffer(); | |
char [] src = zenkaku.toCharArray(); | |
for (char c : src) { | |
if (c >= 0xff10 && c <= 0xff19) { | |
ret.append((char)(c - 65248)); | |
} else { | |
ret.append(c); |
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 static final String SPACE = "[\\s\u3000]"; | |
public static final String NUMBER = "[0-9\uff10-\uff19]"; // 0-90-9 | |
public static final String HYPHEN = "[-\uff0d\u2212]"; | |
public static final String NOT_NUMBER_OR_HYPHEN = "[^" + NUMBER.substring(1, NUMBER.length()-1) + HYPHEN.substring(1); | |
public static final String REGEX_POSTCODE = | |
"(?:" + NOT_NUMBER_OR_HYPHEN.substring(0, NOT_NUMBER_OR_HYPHEN.length() - 1) + "\\)]|^)" + | |
"\u3012?" + | |
SPACE + "*(" + NUMBER + "{3})" + | |
SPACE + "*" + HYPHEN + |
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 static final String SPACE = "[\\s\u3000]"; | |
public static final String NUMBER = "[0-9\uff10-\uff19]"; // 0-90-9 | |
public static final String HYPHEN = "[-\uff0d\u2212]"; | |
public static final String NOT_NUMBER_OR_HYPHEN = "[^" + NUMBER.substring(1, NUMBER.length()-1) + HYPHEN.substring(1); | |
public static final String NUMBERS = "([0-9\uff10-\uff19\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+)"; // 0-90-9一二三四五六七八九 | |
public static final String CHOUME = "\u4e01\u76ee"; // 丁目 | |
public static final String BANCHI = "\u756a\u5730?"; // 番地 | |
public static final String GOU = "\u53f7"; // 号 |
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
-- add temporary column for storing geometry with correct SRID | |
select AddGeometryColumn('places', 'geom_4301', 4301, 'GEOMETRY', 2); | |
-- add temporary column for storing geometry with target SRID | |
select AddGeometryColumn('places', 'geom_4326', 4326, 'GEOMETRY', 2); | |
BEGIN; | |
-- set the source temporary column with geometries with corrected SRID | |
UPDATE places SET geom_4301 = 'SRID=4301;POINT('|| ST_X(geom) || ' ' || ST_Y(geom) || ')'; |
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
# do configure | |
./configure --prefix=/usr --without-mecab | |
# compile nfkc.c manually before make | |
cd lib | |
../libtool --tag=CC --mode=compile \ | |
gcc -I. -I.. -Wall -O0 -fno-strict-aliasing -g -MT nfkc.lo \ | |
-MD -MP -MF .deps/nfkc.Plo -c -o nfkc.lo nfkc.c | |
# do make |