Skip to content

Instantly share code, notes, and snippets.

View pr-lawrence's full-sized avatar
🐵
Calm

Lawrence Kim pr-lawrence

🐵
Calm
View GitHub Profile
@pr-lawrence
pr-lawrence / gist:69214cfabc31808cc237
Created March 1, 2015 06:21
20150301- 3차 스터디 김경범
1. docs(guide): minor grammar fixes
2. doc(guide): Fix examples of $location.html5mode
3. doc(guide): Fixed typos at the unit tests guide
4. docs(ngMock.$httpBackend): fix variable declaration
5. docs(rootScope): correct code examples
6. docs($injector): clarify $inject property description
Section heading about `$inject` property refers to it as `$injector` property.
7. test(ngBindHtml): prevent variable name leak
Add "var" so element is local instead of global
8. docs($cookies): added example to $cookies api docs
@pr-lawrence
pr-lawrence / fileFixit.scala
Created December 16, 2014 17:10
File-Fix-it
object Main {
def solve(existDir: Set[String], createdDir: Set[String]): Int = {
def makeSubset(dir: Set[String]): Set[String] = {
dir.flatMap((c) => c.split("/").foldLeft(List[String]()) { (m: List[String], n: String) => m ++ Set((m.lastOption ++ List(n)).mkString("/")) }.toSet -- Set(""))
}
(makeSubset(createdDir) -- makeSubset(existDir)).size
}
@pr-lawrence
pr-lawrence / SavingTheUniverse.scala
Created October 31, 2014 13:04
Saving the universe
import java.io.PrintWriter
import scala.io.Source
import java.io.File
object Main {
val in = Source.fromFile("large.in").getLines
val printer = new PrintWriter(new File("large.out"))
def getMaxIdx(searchEngines: List[String], queries: List[String]): Int = {
import java.io.PrintWriter
import scala.io.Source
import java.io.File
object Main {
val in = Source.fromFile("sample.in").getLines
val printer = new PrintWriter(new File("large.out"))
case class Box(count: BigInt, tp: BigInt)
package crossTheMaze
import scala.io.Source
import java.io.File
import java.io.PrintWriter
object crossTheMazeMain {
sealed abstract class Direction {
def adj(x: Int, y: Int): List[(Int, Int, Direction)]
}
import scala.io.Source
import java.io.PrintWriter
import java.io.File
object main {
val in = Source.fromFile("large.in").getLines
val printer = new PrintWriter(new File("large.out"))
val pre = "double triple quadruple quintuple sextuple septuple octuple nonuple decuple".split(" ").toList