일기2015. 2. 23. 11:21

  인생을 살아가는데 있어서 절대로 빼놓을 수 없는 것들엔 소통과 인간관계가 포함된다. 

  소통을 함에 있어서 중요한건 본인의 생각을 전달 혹은 설득하는 과정이 있다. 그동안은 글쓰기를 할 때와 말을 할 때를 각각 분리해서 생각했다. 글쓰기로 생각을 표현할 땐, 문단의 구성을 신경썼고, 각 문단마다 하고자 하는 말의 목적을 분명히 해야한다고 배웠다. 그러나, 대화를 할때는 이런 사실들을 전혀 고려치 않고 내 멋대로 말을 했다. 아무리 편한 친구와 대화를 하더라도, 어느 정도는 글쓰기에서 배웠던 규칙들을 지켜야 한다고 최근 들어서야 느꼈다. 그렇지 않으면 실없고 장황한 사람이 되버리기 쉽다.

  학창시절부터 인간관계에 대한 고민을 참 많이 해왔다. 지금까지 십 수년의 시간동은 그렇게 고민하고 바꾸려고 노력해왔다. 어린 시절엔 이 나이 즈음 되면 나름 성인군자가 될 수 있다고 생각했지만, 완전히 틀린 생각이었다. 지금 느끼는 바로는, 평생을 고민해도 절대 성인군자의 발 끝에도 못 미칠 것이다. 그리고 앞으로도 상당한 시간을 인간관계에 대한 고민으로 보내야 하고 마음을 다스려야 한다고 생각한다. 

  대부분의 일은 사람들 때문에 웃고 힘들고 한다. 앞으로도 수 십년간 소통과 인간관계로 고민할 생각을 하니 벌써부터 걱정이 된다. 하지만, 사람들과 어울리는 일은 언제나 기대되고 재밌는 일임에는 틀림없다.  

'일기' 카테고리의 다른 글

벤쳐 생활을 마치며.  (1) 2011.11.02
아 이런 어처구니 없는 일이....  (0) 2010.12.20
텍스트큐브에서 티스토리로 이사했습니다.  (0) 2010.12.18
이사했습니다.  (0) 2010.03.21
이사왔습니다.  (0) 2010.03.09
Posted by 준피
Computer Science/Algorithm2014. 6. 29. 23:17

1. Sort and find: O(nlogn)


2. Quick Select: O(n)

Quick Select: It is similar to Quick Sort about partitioning, but it does not need to sort all elements in an array. The most important thing is the location of pivot. If k, an index of the array, is less than an index of pivot, we need to care about only left part of k. We do not need to worry about a right side of pivot.


Ideal case: n + n/2 + n/4 + .... = n(1 + 1/2 + 1/4 + ....) = n ( 1 / (1 - 1/2) ) = 2n = O(n)

* Sn = a + ar + ar^2 + ar^3 + ... + ar^(n-2) + ar^(n-1) = a / (1 - r)


QuickSelect.groovy

def swap(list, a, b) {
    def temp = list[a]
    list[a] = list[b]
    list[b] = temp
}

def partition(list, pivot, left, right) {
    def storeIdx = left
    swap(list, pivot, right)

    for(int i = left; i < right; ++i) {
        if(list[i] < list[right]) {
            swap(list, i, storeIdx)
            storeIdx++
        }
    }
    swap(list, storeIdx, right)
    return storeIdx
}

def select(list, k, left, right) {
    while(true) {
        def pivot = new Random().nextInt(right - left +1) + left
        println "pivot = " + pivot

        def newPivot = partition(list, pivot, left, right)
        println list

        if(k == newPivot) {
            return list[k]
        } else if (newPivot < k) {
            left = newPivot + 1
        } else {
            right = newPivot - 1
        }
    }
}

def list = [9,8,7,4,5,0,2,1,6,3]
def left = 0
def right = list.size() - 1
def k = new Random().nextInt(right - left + 1 ) + left

println "k = " + k
println list

def answer = select(list, k, left, right)
println "[ANSWER] " + answer






'Computer Science > Algorithm' 카테고리의 다른 글

quick sort - Java  (0) 2011.05.30
quick sort - c  (0) 2011.05.30
insertion sort - c  (0) 2011.05.28
insertion sort - Java  (0) 2011.05.26
binary search - Java  (0) 2011.05.17
Posted by 준피
Drupal2013. 6. 25. 02:39

1. execute these instructions
# sudo a2enmod rewrite
# sudo apache2ctl -l

2. replace the occurrence of AllowOverride None to AllowOverride all
# vi /etc/apache2/sites-enabled/000-default

<VirtualHost *:80> ServerAdmin admin@localhost DocumentRoot /var/www/ <Directory /> Options FollowSymLinks AllowOverride all <- change this line like that </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride all
<- change this line like that Order allow,deny allow from all </Directory>


3. restart apache

# sudo service apache2 restart



reference site : here


Posted by 준피
Server-Side/PHP2013. 6. 11. 03:10
# apt-get --purge remove php5-common
# apt-get install php5 phpmyadmin


reference site 

https://netbeans.org/kb/docs/php/configure-php-environment-ubuntu.html

'Server-Side > PHP' 카테고리의 다른 글

[PHP] how to install memcached on Windows XP  (0) 2010.10.14
[PHP] 정규식으로 한글 영어 숫자 추출하기  (1) 2010.10.12
[PHP] MongoDB 사용하기  (0) 2010.08.17
FirePHP 사용법  (0) 2010.07.20
post raw data  (0) 2010.07.20
Posted by 준피
Server-Side/Java2012. 11. 16. 00:00


VM options 를 아래와 같이 주면 된다.

  -encoding euc-kr -charset euc-kr -docencoding euc-kr 


VM options가 어딨는지 모른다면 여기를 참고하기.

Posted by 준피