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 cats.data.Reader | |
import cats.syntax.applicative._ | |
type MyReader[A] = Reader[String, A] | |
false.pure[MyReader] | |
// reader.scala:5: ambiguous implicit values: | |
// both method catsDataCommutativeMonadForKleisli in class KleisliInstances of type [F[_], A](implicit F0: cats.CommutativeMonad[F])cats.CommutativeMonad[[γ$7$]cats.data.Kleisli[F,A,γ$7$]] | |
// and method catsApplicativeForArrow in object Applicative of type [F[_, _], A](implicit F: cats.arrow.Arrow[F])cats.Applicative[[β$0$]F[A,β$0$]] | |
// match expected type cats.Applicative[ammonite.$file.experiments.reader.MyReader] |
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
{-# LANGUAGE BangPatterns #-} | |
module Timer | |
( timer | |
, timer_ | |
) where | |
import Data.Time | |
timer :: IO a -> IO a |
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
merge :: Integer -> Integer -> Integer | |
merge i1 i2 = merge' i1 i2 (length i1) (length i2) 0 | |
where | |
merge' _ _ 0 0 acc = acc | |
merge' _ i2' 0 l2 acc = acc * 10 ^ l2 + i2' | |
merge' i1' _ l1 0 acc = acc * 10 ^ l1 + i1' | |
merge' i1' i2' l1 l2 acc = merge' rest1 rest2 (l1 - 1) (l2 - 1) acc' | |
where | |
(first1, rest1) = split i1' l1 | |
(first2, rest2) = split i2' l2 |
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
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
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
# Enable SSL3 | |
[Net.ServicePointManager]::SecurityProtocol = 'Tls12' | |
# get current IP | |
$ip = (Get-NetIPAddress -AddressFamily IPv4 | Where-Object {$_.InterfaceAlias -like '*ethernet*'}).IPAddress | |
$port = 3389 | |
if($ip.StartsWith('192.168.') -or $ip.StartsWith('10.240.')) { | |
# new environment - behind NAT | |
$port = 33800 + $ip.split('.')[3] |
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
namespace MyAssembly | |
{ | |
[TestFixture] | |
public class TestSuite | |
{ | |
[Test] | |
public void Test() | |
{ | |
doSomething(); |
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 org.junit.Before; | |
import org.junit.Test; | |
import static org.junit.Assert.assertNotEquals; | |
import static org.junit.Assert.assertTrue; | |
/** | |
* @author Murzinov Ilya, [email protected] | |
* Date 12.06.14 | |
*/ |
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 java.io.*; | |
import java.math.BigInteger; | |
public class Main { | |
public static String inName = "input.txt"; | |
public static String outName = "output.txt"; | |
public static void main(String[] args) { | |
try { | |
String line; |
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 java.io.*; | |
import java.util.HashMap; | |
import java.util.Map; | |
public class Main2 { | |
public static String inName = "input.txt"; | |
public static String outName = "output.txt"; | |
public static void main(String[] args) { | |
try { |