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 ru.mipt.sport.gui.competition; | |
import java.awt.event.ActionEvent; | |
import java.awt.event.KeyEvent; | |
import java.util.ArrayList; | |
import java.util.List; | |
import javax.persistence.EntityManager; | |
import javax.swing.*; | |
import ru.mipt.sport.model.entity.RunResultEntity; | |
import ru.mipt.sport.model.entity.RunResultEntryEntity; |
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
754 , | |
783 , | |
769 , | |
744 , | |
783 , | |
811 , | |
791 , | |
758 , | |
725 , | |
766 , |
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 object RxParse { | |
public fun login(username: String, password: String): Observable<ParseUser> { | |
return Observable.create { subscriber -> | |
try { | |
val user = ParseUser.logIn(username, password) | |
subscriber.onNext(user) | |
subscriber.onCompleted() | |
} catch (ex: ParseException) { | |
subscriber.onError(ex) |
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
interface Presenter<in V, in R> { | |
fun create() | |
fun attachRouter(router: R) | |
fun attachView(view: V) | |
fun detachView() |
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
class PresenterRetainedFragment : Fragment() { | |
private val presenters = mutableMapOf<String, Any>() | |
private var savedState: Bundle? = null | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
retainInstance = true |
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 re | |
import sys | |
def convert(s): | |
parts = s.split('_') | |
r = [] | |
for part in parts: | |
s1 = re.sub('(.)([A-Z][a-z]+)', r'\1 \2', part) | |
s1 = re.sub('([a-z0-9])([A-Z])', r'\1 \2', s1).lower() | |
r.append(s1) |
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 re | |
import sys | |
def convert(s): | |
parts = s.split('_') | |
r = [] | |
for part in parts: | |
s1 = re.sub('(.)([A-Z][a-z]+)', r'\1 \2', part) | |
s1 = re.sub('([a-z0-9])([A-Z])', r'\1 \2', s1).lower() | |
r.append(s1) |
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
/** | |
* Posts true on soft keyboard open, false on close. | |
* This creates a strong reference to activity instance. Make sure to call ActivitySubscription.dispoose() | |
* @param visibleThresholdDp if global activity layout changed more than by 100(default) dp | |
* | |
* @return activity subscription object that allows to unregister listener | |
*/ | |
fun Activity.addSoftKeyboardVisibilityListener( | |
visibleThresholdDp: Int = 100, | |
initialState: Boolean = false, |
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
fun <T, B> createJsonRpcService(service: Class<T>, | |
client: JsonRpcClient<B>, | |
resultDeserializer: Deserializer<B>, | |
logger: (String) -> Unit = {}): T { | |
val classLoader = service.classLoader | |
val interfaces = arrayOf<Class<*>>(service) | |
val invocationHandler = createInvocationHandler(service, client, resultDeserializer, logger) | |
@Suppress("UNCHECKED_CAST") |
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
--> {"jsonrpc": "2.0", "method": "subtract", "params": {"minuend": 42, "subtrahend": 23}, "id": 3} | |
<-- {"jsonrpc": "2.0", "result": 19, "id": 3} |
OlderNewer