Instead of the verbose setOnClickListener
:
RxView.clicks(submitButton).subscribe(o -> log("submit button clicked!"));
Observable
.just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
fun main() { | |
println(palindromeIndex("aaa")) | |
} | |
fun palindromeIndex(s: String): Int { | |
val reversed = s.reversed() | |
if (s == reversed) return -1 | |
for (i in 0 until s.length) { | |
var countLeft = 0 |
import { useReducer, useEffect } from 'react'; | |
import { useSwipeable, SwipeableHandlers, EventData } from 'react-swipeable'; | |
function previous(length: number, current: number) { | |
return (current - 1 + length) % length; | |
} | |
function next(length: number, current: number) { | |
return (current + 1) % length; | |
} |
import android.app.Activity | |
import android.app.Service | |
import android.content.ComponentName | |
import android.content.Context | |
import android.content.Intent | |
import android.content.Intent.EXTRA_SUBJECT | |
import android.content.Intent.EXTRA_TEXT | |
import android.net.Uri | |
import kotlin.properties.ReadWriteProperty | |
import kotlin.reflect.KClass |
/* | |
* Copyright 2017 Google Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
// | |
// BaseGeolocable.swift | |
// | |
// Created by Juan Felipe Alvarez Saldarriaga on 11/11/16. | |
// | |
import Foundation | |
import CoreLocation | |
protocol BaseGeolocable: class, CLLocationManagerDelegate { |
import android.app.Activity; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.pm.ResolveInfo; | |
import android.content.res.AssetFileDescriptor; | |
import android.database.Cursor; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.graphics.Matrix; | |
import android.media.ExifInterface; |
/* http://meyerweb.com/eric/tools/css/reset/ | |
v2.0-modified | 20110126 | |
License: none (public domain) | |
*/ | |
html, body, div, span, applet, object, iframe, | |
h1, h2, h3, h4, h5, h6, p, blockquote, pre, | |
a, abbr, acronym, address, big, cite, code, | |
del, dfn, em, img, ins, kbd, q, s, samp, | |
small, strike, strong, sub, sup, tt, var, |
# Set variables in .bashrc file | |
# don't forget to change your path correctly! | |
export GOPATH=$HOME/golang | |
export GOROOT=/usr/local/opt/go/libexec | |
export PATH=$PATH:$GOPATH/bin | |
export PATH=$PATH:$GOROOT/bin |