[java] java 1.7 concurrent package

https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/package-frame.html

Executor

An object that executes submitted Runnable tasks. You can customize the tactic which handle Runnable Object how to execute and manage execution order.

ExecutorService (More useful)

An Executor that provides methods to manage termination and methods that can produce a Future for tracking progress of one or more asynchronous tasks.

  • invokeAll
  • invokeAny
  • shutdown
  • submit

Callable (Overcome runnable)

A task that returns a result and may throw an exception. Implementors define a single method with no arguments called call.

Future

A Future represents the result of an asynchronous computation.

[ios] 텍스트 검색 (Latin Lingual)

영어 발음으로 검색을 지원할 때

다음 코드는 text -> 영어(latin)으로 치환해준다.

NSMutableString *mutableQuery = [[NSMutableString alloc] initWithString:query];
CFStringTransform((CFMutableStringRef)mutableQuery, NULL, kCFStringTransformToLatin, false);
CFStringTransform((CFMutableStringRef)mutableQuery, NULL, kCFStringTransformStripCombiningMarks, false);

치환된 코드를 가지고 DB에서 like검색을 하거나
메모리에 일부를 올려 일치 여부 또는 포함 여부를 필터 하면 된다.

중국어나 일본어나 한국어를 영어발음으로 검색하고 싶을 때(키보드 두드리기 어려울 때) 유용하다.

출처 Git  : Telegram iOS

=========================

If you want to offer text search in ios lingual below source code may need.

NSMutableString *mutableQuery = [[NSMutableString alloc] initWithString:query];
CFStringTransform((CFMutableStringRef)mutableQuery, NULL, kCFStringTransformToLatin, false);
CFStringTransform((CFMutableStringRef)mutableQuery, NULL, kCFStringTransformStripCombiningMarks, false);

Transform text (Korean, Japanese, Chinese…etc) to latin lingual format.

And then do it your way.

source : Git  : Telegram iOS