Skip to content

Instantly share code, notes, and snippets.

View lu911's full-sized avatar
🎯
Focusing

Seungchan Yuk lu911

🎯
Focusing
View GitHub Profile
@lu911
lu911 / set_method.scala
Last active December 20, 2015 21:09
Set method test
object Main {
def main(args: Array[String]): Unit = {
new SetMethods()
}
}
class SetMethods {
private val digits = Set(1,3,5,7)
@lu911
lu911 / iterable.scala
Last active December 20, 2015 21:09
Iterable method test
object Main {
def main(args: Array[String]): Unit = {
new IteratorMethods()
}
}
class IteratorMethods(){
private val iterable = Iterable(1,2,3,4,5)
val methods = List(method)
@lu911
lu911 / SeqMethods.scala
Last active December 20, 2015 21:09
seq method test
object Main {
def main(args: Array[String]): Unit = {
new SeqMethods()
}
}
class SeqMethods {
private val digits = Seq(1,3,5,7)
private val chars = Seq("a", "b", "c", "d", "a", "c", "b")
@lu911
lu911 / function_mapping.scala
Last active December 20, 2015 21:19
Scala Function Mapping
import scala.collection.mutable.ArrayBuffer
import scala.collection.mutable.LinkedList
import scala.collection.mutable.BitSet
import java.util.LinkedHashSet
object Main {
def main(args: Array[String]): Unit = {
new FunctionMapping()
}
}
@lu911
lu911 / stream.scala
Last active December 20, 2015 21:19
Stream
object Main {
def main(args: Array[String]): Unit = {
new StreamMethods()
}
}
class StreamMethods{
val methods = List(streamTest)
def numsFrom(n : BigInt): Stream[BigInt] = n #:: numsFrom(n + 1)
@lu911
lu911 / pattern_matching.scala
Last active December 20, 2015 21:39
Pattern Matching
object Main {
def main(args: Array[String]): Unit = {
new PatternMatching()
}
}
class PatternMatching{
val methods = List(_match, _match2, guard, patternVar, patternGuardVar, typePattern, arrMatch, lstMatch, pairMatch, caseClass, optionMatch, partialFunction)
def _match(): Unit = {
@lu911
lu911 / crawl.py
Last active December 21, 2015 01:29
naver movie reply crawl
import re, urllib, httplib, time
class Mining(object):
r = re.compile(ur'class="score_reple">\s*<p>(.*?)</p>')
def __init__(self, code):
positive = []
negative = []
for page in range(1,2):
[positive.append(data) for data in self.get_data(code, 'highest', page)]
time.sleep(2)
@lu911
lu911 / akka-actor-test.scala
Created August 17, 2013 00:26
Akka Actor Test
import akka.actor.{Props, ActorSystem, Actor}
/*
* Copyright © 2013 Yuk SeungChan, All rights reserved.
*/
object Main {
def main(args: Array[String]): Unit = {
println("*" * 20 + " Actor Registry " + "*" * 20)
new LogGenerator().run(100)
@lu911
lu911 / actor.scala
Created August 29, 2013 05:31
Actor Example ping-pong
import scala.actors.Actor
object Main {
def main(args: Array[String]): Unit = {
val pong = new Pong
val ping = new Ping(100000, pong)
ping.start
pong.start
}
@lu911
lu911 / actor-channel.scala
Created August 29, 2013 06:30
Actor Channel Example
/*
* Copyright © 2013 Yuk SeungChan, All rights reserved.
*/
package main.scala
import scala.actors.{Channel, OutputChannel, Actor}
object Main {
def main(args: Array[String]): Unit = {