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 / identify_timezone.py
Last active December 17, 2015 03:38
identify_timezone
#-*-coding:utf8-*-
from study.models import *
from BeautifulSoup import BeautifulSoup
import re,datetime
exclude_words = [u'1:1', u'명', u'문장', u'시간', u'PT', u'세', u'일', u'월']
time_regex = [ur'((?:저녁|아침)(?:시간)?|AM|PM|오(?:전|후))?\s*([0-2]?\d)\s*([시:])?\s*((?:[0-5]?\d분?|반))?\s*((?:저녁|아침)(?:시간)?|명|AM|PM|오(?:전|후))?\s*((?:-|–|~|부터|또는))\s*((?:저녁|아침)(?:시간?)?|AM|PM|오(?:전|후))?\s*([0-2]?\d)\s*([시:])\s*((?:[0-5]?\d분?|반))?\s*((?:저녁|아침)(?:시간)?|AM|PM|오(?:전|후))?',
ur'((?:저녁|아침)(?:시간)?|오(?:전|후))\s*([0-2]?\d)\s*([시:])?\s*((?:[0-5]?\d분?|반))?\s*((?:-|–|~|부터|또는))\s*((?:저녁|아침)(?:시간?)?|오(?:전|후))?\s*([0-2]?\d)\s*([시:])?\s*((?:[0-5]?\d분?|반))?',
ur'((?:저녁|아침)(?:시간)?|오(?:전|후))?\s*([0-2]?\d)\s*([시:])?\s*((?:[0-5]?\d분?|반))?\s*((?:-|–|~|부터|또는))\s*((?:저녁|아침)(?:시간?)?|오(?:전|후))\s*([0-2]?\d)\s*([시:])?\s*((?:[0-5]?\d분?|반))?',
@lu911
lu911 / domain.js
Last active December 17, 2015 23:29
domainAPI - error occured from 'errorHandler'
var domain = require('domain').create(),
errorFlag = true;
domain.on('error', function()
{
console.log('error catch');
if(errorFlag == true)
errorHandler();
console.log(this)
});
@lu911
lu911 / property.scala
Last active December 20, 2015 10:19
Scala Property
package org.sunrin
import scala.beans.BeanProperty
class Property
{
var varProperty = "var"
val valProperty = "val"
private var privateVarProperty = "private_var"
@lu911
lu911 / private-field.scala
Created August 3, 2013 04:29
Private Field
object Main {
def main(args: Array[String]): Unit = {
val test = new Test;
test.increment()
test.isLess(new Test());
test.print();
}
class Test
@lu911
lu911 / assistance-constructor.scala
Created August 3, 2013 04:35
Assistance Constructor
object Main {
def main(args: Array[String]): Unit = {
val p1 = new Person
val p2 = new Person("Loup")
val p3 = new Person("Loup", 19)
}
class Person
{
@lu911
lu911 / constructor.scala
Created August 3, 2013 04:39
constructor
object Main {
def main(args: Array[String]): Unit = {
val p1 = new Person("Loup", 19)
}
class Person(val name: String, val age: Int)
{
println("Hello " + name + "(" + age + ")")
}
@lu911
lu911 / companion-object.scala
Created August 3, 2013 04:57
companion object
object Main {
def main(args: Array[String]): Unit = {
val p1 = Person.apply("Loup")
val p2 = Person("Loup")
}
class Person(val id: Int, val name: String)
{
println("Hello " + name)
@lu911
lu911 / inner-class.scala
Created August 3, 2013 05:06
Inner class
import scala.collection.mutable.ArrayBuffer
object Main {
def main(args: Array[String]): Unit = {
val n1 = new Network
val n2 = new Network
val loup = n1.join("loup")
val bob = n2.join("bob")
@lu911
lu911 / application-object.scala
Created August 3, 2013 05:10
Application object
import scala.collection.mutable.ArrayBuffer
/*
object Main {
def main(args: Array[String]): Unit = {
}
}
*/
@lu911
lu911 / collection.scala
Last active December 20, 2015 20:59
Scala Collection
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 Collection()
}
}