Scala의 foldLeft, foldRight에 대한 설명을 들으며 이런 생각이 들었다.


foldLeft, foldRight의 차이점을 바탕으로 재귀호출의 형식을 구분하면,

  1. 현재 stack에서 계산한 결과를 다음 재귀호출의 인자로 사용하는 것.
  2. 재귀호출의 결과를 현재 stack에서 수행해야 할 계산의 인자로 사용하는 것.
  3. 1과 2를 모두를 조합한 것.


tail-recursion 가능 여부는

  • 1을 잘 다듬으면 tail-recursion으로 만들 수 있지만
  • 2와 3은 복귀해야 할 stack이 존재하므로 tail-recursion으로 만들 수 없다.


15년 만에 재귀호출을 조금 이해한 느낌이다.




Posted by 배트
,

'learnyounode' is a set of self-guided workshops. It is installed easily via npm and the content is also so great.


I'm new to Node.js. This is a wonderful entry point to get involved into node world!


Even though I just finished this practice and haven't had much information about how to utilize node, I'm just gonna proceed to build a simple API server. I'm so excited with expecting how simple the code will be!


To get information about this practice, check this:

https://github.com/workshopper/learnyounode


My practice code is here:

https://github.com/batt842/learnyounode

Posted by 배트
,

recuperate

[v] When you recuperate, you recover your health or strength after you have been ill or injured.

> I went away to the country to recuperate.

> He is recurring from a serious back injury.


tame

[adj] A tame animal or bird is one that is not afraid of humans.

>The deer never became tame; they would run away if you approached them.

[adj] If you say something or someone is tame, you are criticizing them for being weak and uninteresting rather than forceful and shocking.

> Some of today’s political demonstrations look rather tame.

> The report was pretty tame stuff

[v] If someone tames a wild bird or animal, they train it not to be afraid of humans to do what they say.

> The Amazons are believe to have been the first to tame horses.

[v] If you tame someone or something that is dangerous, uncontrolled, or likely to cause trouble, you bring it under control.

> Two regiments of cavalry were called out to tame the crowds.


gag

[cnt.n] A gag is something such as a piece of cloth that is tied around or put inside someone’s mouth in order to stop someone from speaking.

> His captor had put a gag of thick leather in his mouth.

[v] If someone gags you, they tie a piece of cloth around your mouth in order to stop you from speaking or shouting.

> I gagged him with a towel.

[v] If a person is gagged by someone with authority, they are prevented from expressing their opinion or from publishing certain information.

> Judges must not be gagged.

[v] If you gag, you cannot swallow and nearly vomit.

> I knelt by the toilet and gagged.

[cnt.n] A gag is joke. [informal]

[v] If you say someone is gagging for something or is gagging to do something, you are emphasizing that they want to have it or do it very much. [informal]

> Girls everywhere are gagging for a car like this.

> There are thousands of students absolutely gagging to come to this university.


gig

[cnt.n.] A gig is a live performance by someone such as a musician or a comedian.

> The two bands join forces for a gig at the Sheffield Area on November 28.

> He supplemented his income with occasional comedy gigs.

[v] When musicians or other performers gig, they perform live in public.

> By the time he was 15, Scoot had gigged with a handful of well-known small band.

> …ten years of gigging in bars and clubs all over Kentucky.

 


Posted by 배트
,

notorious

[adj] To be notorious is well-known for something bad.

> She told us the story of Britain's most notorious country house murders.


scrutinize

[v] If you scrutinize something, you examine it very carefully, often to find out some information from it or about it.

> Her purpose was to scrutinize his features to see if he was an honest man.


epidemic

[c.n.] If there is an epidemic of a particular disease somewhere, it affects very large number of people there and spreads quickly to other areas.

> A flu epidemic is sweeping through Moscow.

[c.n.] If an activity that you disapproved of is spreading or increasing rapidly, you can refer to this as an epidemic of that activity.

> Drug experts say that it could spell the end of the crack epidemic.


fad

[c.n.] You use a fad to refer to an activity or topic of interest that is very popular for a short time, but which people get bored with very quickly.

> Hamnett does not believe environmental concern is a passing fad.

syn. craze, fashion, trend, fancy


Posted by 배트
,

in one's favor

- to one's advantage.

> I think you get the job. Being bilingual works definitely in your favor.


strive

- If you strive to do something or strive for something, you make a great effort to do it or get it.

- It's a little confusing with the world stride.

> I'm striving to be a better person.

> National movements were striving for independence.


I need to show others what I'm capable of doing.


a misdemeanor of charge trespassing

more details : http://misdemeanorguide.com/Misdemeanor-trespassing.php


demeanor [AM], demeanour [BR]

Your demeanour is the way you behave, which give people an impression of your character and feelings.


Posted by 배트
,

I've been learning English for many years.

I don’t have enough opportunities to use and improve my English in practical ways.

I’m confused. What should I do to achieve my goal? –to master intermediate English and use English in daily life-

Firstly, It’s appropriate or helpful to write some article on this blog in English?


Well. I’m getting nervous and impatient.

Let’s list up important values for using and learning English.

sustainability

practicality

daily basis

compelling / funny / interesting

balancing between reading, writing, listening, and speaking

conversation and feedback with people (not only in study)



What are effective and appropriate activities?

I should keep them up steadily and consciously.

Tele-english (Speaking, Listening)

Watching show programs (Listening)

Language exchange (Speaking, Listening, more interesing)

Reading technical articles related to my job in English (Reading)

Writing learning progress in English

Exchanging opinions in internet community


It may... make sense.


Next- I'm going to find specific -real- activities.

Posted by 배트
,

2016-03-11 ~ 2016-03-12


강의 내용보다는 기존에 몰랐던 표현을 수집하는데 치중.


Home improvement project

My mother asked me to hang it up.

My mother had a white cloth wrapped around her thumb.

swell

-       swell-swelled-swollen

-       [IV] to become larger and rounder than usual, if music swells it become louder

-       [TV] to cause to become swollen

-       [ADJ] very good

-       [ADV] very well

-       [N] the slow and up and down movement of the sea with large but smooth wave

Still confusing…

-       see a doctor

-       see the doctor

get something done

-       When a new task is generated, I get it done right away.

 



Eating out

I used to go to the restaurant in a shopping mall.

The first floor, the second floor, …

As far as I remember

I second your opinion.

-       agree, support, approve…

If my computer hadn’t broken, I wouldn’t have finished the job.

Look at the time. The match will have started.

I phoned at six o’clock. I knew you would have got home by then.

 



Weather

I hear the meteorologists saying…

insane amount of snowfall

get trapped in

the whole planet

climate change, global warming

-       are used without ARTICLES

 



Banking

a valid ID.

a driver’s license.

fill out a form, fill out an application

-       “write a form” is wrong

bank teller / bank clerk

bankbook / passbook

now you are all set!

 



Geographic features

as much detail as possible

The island located south of the southern coast of the Korea Peninsular.

a central feature

a volcanic island, a (dormant/active) volcanic mountain

is often called the ‘Hawaii’ of Korea

it has subtropical forests

it is one of the most famous travel destination, it has many tourism spots.

 



Meeting arrangement

contribute to something

discuss something

We no longer can excuse ourselves from anyone, anything.

They are too immature to deal with those tough tasks.

Equipment

-       is an uncountable noun.

-       means a set of thing that you need for a particular purpose.

-       We’ve bought new camping equipment, including new sleeping bags and a little refrigerator.

-       All of Vincent’s camera equipment was stolen from his car, except only one piece of equipment. (a piece of equipment)

Hey, I’m not listening! you’re breaking up!

-       An online connection is getting noisy and almost disconnected.

Now that + a reason or an explanation

-       Now that I live only a few block away from work, I walk to work and enjoy it.

go over

-       to consider, examine, or check something: My boss told me that I should go over the proposal even on my commute.

-       to change one’s allegiance or religion: You don’t want to go over to the republican party.

-       to be received by a specific way: His earnestness would go over well in a courtroom.

 



Role Play1

-       planning to watch a movie

-       calling a friend to set up an appointment

Have you had a chance to –

-       Have you had a chance to check out the latest releases at a theater?

-       (polite, formal) Have you had a chance to consider my request?

It’s out this week = It’s release this week

When are you free this week?

How’s Saturday for you?

the morning, the afternoon, the evening, the night

grab dinner and catch a movie.

Do you have a credit card which gives us a discount for the movie?

 



Role Play2

-       online shopping crisis

-       Complaining about the late delivery

online – adjective & adverb

I’m calling about -

It still hasn’t arrived. What? It hasn’t been shipped?

I need it by this Wednesday at the latest.

Talk to your manager and please get back to me (=call me back) before 6 pm today.



Posted by 배트
,

2016-03-07 ~ 2016-03-10


강의 내용보다는 기존에 몰랐던 표현을 수집하는데 치중.


Colleagues

- Trouble with a co-worker

- Dealing with the problem


This has been my presentation about something something.

work my way up to a full time position.

to make progress on a process or structure.

to be given or get a promotion

have breakfast/lunch/dinner.

without any definite/undefinite article

walk away

to stop being involved in a situation because it is difficult to deal with or does not give you any advantage.

it is wrong of someone to do that.

It is wrong of me to drive violently.

There's something wrong with me, wrong with my heart.

let something out

talk a problem out

to resolve a problem by talking




Company & Work

- About the first project

- Comparing past & present work


participate in

have the added responsibility (or responsibilities)

have less responsibility.

I would go to the park.  ≈ I used to go to the park.




Movies

- Recently watched movie

- About the Movie

 

Potluck party

When saying about a movie, use present tense.

abduct

To take away to an undisclosed location against their will and usually in order to extract a ransome (kidnap)

To pull away from the body

cannot stand

the credits went up…

Artic – Antarctic

The negative of used to

-       used not to: formal or British

-       didn’t used to: informal or America

-       never used to: always OK

-       Reference : http://www.pearsonlongman.com/ae/azar/grammar_ex/message_board/archive/articles/00074.htm

 



Cafes

-       First visit to a café

-       The reason and the experience


Two coffees, three Cokes

-       are accepted in modern English, at a place where they serve drinks.

-       it’s better to use two cans of coffee, three bottles of Coke, a six-pack of beer in the store.

graduate from

-       I’ve graduated from the graduate school.

a mark of a college student

-       Drinking coffee is a mark of a college student.

at the time = at that time

throw up

-       To eject contents from the stomach through the mouth (vomit, vomit up)

as possible as it can

-       as far as possible

-       as [adjective] as possible (eg: as soon as possible)

 


 

Parks

-       Changes of your favorite park

-       Cause of the change

 

What do you think caused the change?

in two different ways, both in how it looks and also in the people who visit.

stagnant

-       not circulating or flowing (stagnant water)

-       not growing or change; without force or vitality

smell awful

-       The pond smelled awful.

become-became-become

What made you decide to become a teacher?

WHEN as a conjunction

-       at or during the time that: I loved maths when I was at school.

-       at or during the time that, after

.   Call me when you’ve finished.

.   There was silence when she finished her description of her trip to Africa.

-       at or during the time that, whenever

.   Can you spare five minutes when it’s convenient?

-       after which and; and just then (implying suddenness)

.   He had just drifted off to sleep when the phone rang.

.   He was about to dictate into his recorder about the progress of his work when his mobile phone rang.

.   I had jus nodded off to sleep when I was woken up by an almighty crash from their house.

-       In view of the fact that; considering that

.   Why bother to paint it when you can photograph it with the same effect.

.   You cannot claim to give the facts straight when there is no-one giving the other view.

-       Although, whereas

.   I’m saying it now again when I should have told you long ago.

BOTHER has the several meanings

-       [V] To make the effort to do something / To annoy, worry, or cause problems for something.

-       [N] a big effort, trouble, worry

SHOULD HAVE is used to talk about past event that did not happen.

-       I should have let her know something horrible was happening there, but I ignored…

-       I shouldn’t have lie to her. I should apologize to her, but she is not here anymore.

-       He should have arrived at his office by now. Let’s try ringing him. (MAY)

-       He shouldn’t have arrived at his office. Because he is always late.

-       Reference: http://www.englishgrammarsecrets.com/shouldhave/menu.php

 



SNS

-       Reason to get interested

-       Change in your interests

in-depth information

We could access the Internet anytime, anywhere.

-       anytime = at any time

-       access the Internet ≈ connect to the Internet

I end up spending more time online.

-       end up : to finally be in a particular place or situation

back in college

 


 

Stock

-       Memorable experience

-       Happening in detail

I trade stocks.

lucky for me = fortunately

have a lot in common.

pronunciation of COMMON

-       BR /ˈkɒmən/

-       AM /ˈkɑː.mən/

We’ve been going out ever since I asked her out on a date. Then, we’re dating now.

My stocks have been skyrocketing.

Thanks to her (Due to her), my skill has improved and so has my salary.




Jogging

-       Memorable incidence

-       Happening in detail

Pronunciation of ROUTE and ROUTER

-       ROUTER is always /ˈruː.tər/ in UK or /ˈraʊ.t̬ɚ/ in US

-       ROUTE is always /ruːt/ in UK. But in the eastern US /ruːt/ is preferred, and in the western US /raʊt/ is preferred.

-       Then I choose /raut/.

could have

-       Future study : http://www.englishgrammarsecrets.com/couldhave/menu.php

go out for a jog

RULE: [article] [adverb] [adjective] [noun]

-       a quite quick runner

There aren’t as many visitors as usual.

I was being followed.

I tripped over a large stone and fell on my face.

TRIP as a verb

-       ≠ HAVE A TRIP

-       to miss a step and fall or nearly fall / to cause stumble

I didn’t know where I was driving.

It’s better to be safe than sorry.



 

Vacation

-       Trend in general preference

-       Comparing past & present

differences between vacations people used to take in the past and the ones they take today.

take a vacation

make money

-       earn money (income)

domestic/international trips/travel

go abroad

bed and breakfast

-       a room to sleep the night and a morning meal, or a private house or a small hotel offering this.

go + do-ing

-       go hiking / swimming / mountain climbing

go + do

-       go see the world, go catch a movie, …

catch a movie

-       “catch a TV” is not used

Nowadays, we are doing much better financially.




Travel

- Memorable place

- Likes & dislike

overseas

-       [adj] Nowadays, I could take overseas trips.

-       [adv] I’ve been saving money to study overseas/abroad.

afford to go on a long overseas trip

-       to be able to buy or do something because you have enough money or time.

.   We can’t afford to send our children to college.

.   There are not many people could afford to take overseas trips.

-       to allow someone to have something pleasant or necessary / to be the cause or source of

.   The hut afforded little protection from the elements.

.   The seat afforded her an uninterrupted view of the stage.

-       to be able to spare or give up

.   I can’t afford to spend two hours with him!

stand out

-       to project from a surface

.   The veins in his neck stood out.

-       to be easily noticeable

.   He was one of those men who stood out in a crowd.

-       to be clearly better or significant than someone or something

.   For issues stand out as being of crucial importance.

-       to persist in opposite or support something

.   She stood out against the Superhero Registration Act.

 


Posted by 배트
,

Note of Content

While people were dying, Assad supporters were laughing and were saying that it was not true there were starving people. But several international aid workers said there are starving residents in real.


Vocabulary

mock [mak] [mOk]

[adj] constituting a copy or imitation of something.

[noun] the act of mocking or ridiculing.

[verb]

1. to treat with contempt.

2. to imitate with mockery and derision.

regime [ru-j:im] [rei-j:im]

[noun]

1. the organization of the governing authority of a political unit. (or simply, the government.)

2. (medicine) a systematic plan for therapy (often including diet)

militant

humanitarian

barbaric [ba:r-bae-rik]

[adj] without civilizing influences. "The series of suicide bomb attack is a barbarian act of terrorism."


My Status

I'm a little tired and feeling difficulty to stay focused.


Note for Study

Nothing comes to mind. Through this way of studying, I'll find out more questions and important ideas.

Also I hope to speed up to finish each session.


Posted by 배트
,

Proxy나 LB처럼 L7 스위칭을 하는 장치를 통과한 HTTP 헤더는 host가 L7 스위치의 주소로 덮어써진다.

L7 스위치를 지날 때마다 이전 주소는 X-FORWARDED-FOR에 차곡차곡 기록되는데,

최초 HTTP request를 한 host의 주소를 알기 위해서는 이 정보를 이용해야 한다.

아래는 Java로 구현된 Controller의 소스 코드이다.


public final class HttpUtils {

    private static final String HEADER_X_FORWARDED_FOR = "X-FORWARDED-FOR";


    /**

     * Returns the original host's IP address of the HTTP request.

     * It ignores any L7 switches.

     * 

     * @param request

     * @return

     */

    public static String getFirstRemoteAddr(HttpServletRequest request) {

        String remoteAddr = request.getRemoteAddr();

        String x;

        if ((x = request.getHeader(HEADER_X_FORWARDED_FOR)) != null) {

            remoteAddr = x;

            int idx = remoteAddr.indexOf(',');

            if (idx > -1) {

                remoteAddr = remoteAddr.substring(0, idx);

            }

        }

        return remoteAddr;

    }

}



출처: http://johannburkard.de/blog/programming/java/x-forwarded-for-http-header.html

Posted by 배트
,