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 Main { | |
Tablitsa tabl = new Tablitsa(); | |
int find(int i, int j){ | |
return tabl.getRecord(i).getColumn(j); | |
} | |
} | |
class Tablitsa { | |
List<Record> records = new ArrayList<>(); |
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 Main { | |
List<List<Integer>> tabl = new ArrayList<>(); | |
void tablitso() { | |
add(tabl); | |
} | |
int find(int i, int j){ | |
return tabl.get(i).get(j); | |
} |
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 Create<K extends Key, V extends Value, Result> { | |
K key(); | |
V value(); | |
Result get(); | |
} | |
interface CrudManager { | |
<K extends Key, R extends OperationResult<String>> |
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
https://gist.github.com/n00neimp0rtant/9515611 |
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 com.nd.ap.visit_metrics.controller | |
import cats.data.NonEmptyList | |
import cats.free.Free | |
import cats.implicits._ | |
import cats.~> | |
import com.nd.ap.avro.visit_metrics._ | |
import com.nd.ap.visit_metrics.controller.dsl._ | |
import com.nd.ap.visit_metrics.controller.dsl.implementation.Sugar.FlatFrees | |
import com.nd.ap.visit_metrics.controller.dsl.implementation.Database._ |
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 com.moex.eif.cantor.backoffice.calculator.settings | |
import java.io.File | |
import java.time.Instant | |
import com.moex.eif.cantor.backoffice.calculator.storage.PlatformEntityDataSource | |
import com.moex.eif.cantor.backoffice.model.GlobalSettings | |
import com.netflix.archaius.api.config.SettableConfig | |
import com.netflix.archaius.api.{ConfigLoader, PropertyContainer} | |
import com.netflix.archaius.config.DefaultSettableConfig |
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
object MyApp extends App { | |
val dao = createDaoImpl() | |
val eventBus = createEventBus() | |
BusinessLogic(dao, eventBus).foo(123) | |
} | |
trait Dao { | |
def findById(id: Long): String | |
} |
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
object Main extends App { | |
val a: Option[Int] = Some(1) | |
val b: Option[Int] = None | |
val c: Option[Int] = Some(2) | |
(a, b, c) match { | |
case (Some(x), None, Some(z)) => | |
println("1") | |
case (Some(x), Some(y), None) => |
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 class Cacher { | |
private static final ConcurrentSkipListMap<CacherKey, Integer> cache = new ConcurrentSkipListMap<CacherKey, Integer>(); | |
public void put(String key, Integer value) { | |
if (cache.size() >= 10) { | |
cache.pollLastEntry(); | |
} | |
cache.put(new CacherKey(System.currentTimeMillis(), key), value); | |
} |
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 test | |
import test.common._ | |
import scala.concurrent.Future | |
object Github extends Github(new HttpClient()) { | |
private val SearchApiUrl = "https://api.github.com/search/repositories" | |
} | |
class Github(httpClient: HttpClient) { |
NewerOlder