This file contains hidden or 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
use std::fs::File; | |
use std::io::{BufRead, BufReader, Result}; | |
use std::collections::HashSet; | |
type Cell = (isize, isize, isize); | |
struct Grid { | |
rows: isize, | |
cols: isize, | |
bugs: HashSet<Cell>, |
This file contains hidden or 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
use std::fs::File; | |
use std::io::{BufRead, BufReader, Result}; | |
use std::collections::HashSet; | |
type Cell = (isize, isize, isize); | |
struct Grid { | |
rows: isize, | |
cols: isize, | |
bugs: HashSet<Cell>, |
This file contains hidden or 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
use std::fs::File; | |
use std::io::{BufRead, BufReader, Result}; | |
use std::collections::{VecDeque, HashMap, HashSet}; | |
type Pos = (i32, i32); | |
#[derive(Debug, Clone)] | |
enum Tile { | |
Free, Key(usize), Door(usize), | |
} |
This file contains hidden or 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
extern crate num_complex; | |
extern crate ordered_float; | |
use std::fs::File; | |
use std::collections::HashSet; | |
use std::io::{BufRead, BufReader, Result}; | |
use ordered_float::OrderedFloat; | |
use num_complex::Complex; | |
type Theta = OrderedFloat<f32>; |
This file contains hidden or 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
use std::io::{Error, ErrorKind, Result}; | |
use std::rc::Rc; | |
use std::cell::RefCell; | |
use crate::int_code::{IntCodeProg, OpResult}; | |
fn perms_rec(res: &mut Vec<Vec<i64>>, vec: &mut Vec<i64>, from: usize) { | |
if from == vec.len() { | |
res.push(vec.clone()); | |
} else { | |
for i in from..vec.len() { |
This file contains hidden or 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
use std::fs::File; | |
use std::io::{BufReader, Result}; | |
use std::io::prelude::*; | |
type Instr = i32; | |
trait InstrOps { | |
fn is_immediate_param(self, nth: usize) -> bool; | |
} |
This file contains hidden or 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 final class InVar { | |
private static final InheritableThreadLocal<String> S = new InheritableThreadLocal<String>() { | |
@Override | |
protected String childValue(String parentValue) { | |
System.out.println("Child called"); | |
return parentValue + "b"; | |
} | |
}; | |
public static void main(String[] args) throws Exception { |
This file contains hidden or 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.apache.flume.sink.elasticsearch.ContentBuilderUtil; | |
import org.elasticsearch.common.xcontent.XContentBuilder; | |
import org.elasticsearch.common.xcontent.XContentFactory; | |
public class JsonPlay { | |
public static void main(String[] args) throws Exception { | |
XContentBuilder strangeBuilder = XContentFactory.jsonBuilder().startObject(); | |
ContentBuilderUtil.appendField(strangeBuilder, "data", "1\t{\"areYouSure\":\"thatItisvalidJson\"}".getBytes()); | |
System.out.println(strangeBuilder.bytes().toUtf8()); |
This file contains hidden or 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 persistence | |
import akka.actor._ | |
import akka.persistence._ | |
import akka.event.Logging | |
import com.typesafe.config.ConfigFactory | |
import AtLeastOnceDelivery.{UnconfirmedDelivery, UnconfirmedWarning, AtLeastOnceDeliverySnapshot} | |
object SimpleJournalActor { | |
case class Command(cmd: Any, id: Long) |
This file contains hidden or 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 persistence | |
import akka.actor._ | |
import akka.event.Logging | |
import akka.persistence._ | |
import AtLeastOnceDelivery.{UnconfirmedDelivery, UnconfirmedWarning} | |
import scala.annotation.tailrec | |
import scala.collection.immutable.ListMap | |
import java.util.UUID |