2013年10月13日星期日

Film Review On Crush

English has a word, called crush. If the dictionary, it will tell you that it was " crushed , crushed , crushed " means. Later, I came to the United States , before we know it as a noun , as well as a layer of meaning : that is , " briefly , but was warmly shy love ." For example , "I had a crush on him", that "I have briefly , warmly , but shyly liked him ."

Crush means, so long, so delicate , I have not found a suitable Chinese word to translate . "Heart " seems to be a very close translation, but the "heart" and "crush" compared to the emotional intensity is more weak , more durable in time , and a little toward love, marriage that aspect enough ambition. Crush is different, it is short-lived, but let you captivated .

I think Crush is a particularly useful vocabulary. It was particularly useful, because I realized that , in fact, the majority of life experience "Love " is "crush" in the form of existence . If you let me counting down , my 30 years in the end the real "love" too many people, I am afraid that is a ...... two ...... absolutely no more than three . But if I think about it, how many people they have had a crush, it is much, Ah , anyway, I am sorry counted .

Love is a tuberculosis , crush it was a cold. Tuberculosis people decimated , survived , colds cough point is just to let you cough , sneeze RBI , but it is from time to time on the attack again.

Crush generally fast and violent . Newcomer to the time , and you will mistakenly think that is love. It broke out , usually by a certain factor suddenly bewitched , cause you start possessed . For example , you are like someone good looking , handsome make you drool . Such as a personal way of speaking that you find particularly comfortable. For example, you saw a person on the Internet an article , do you think , write nice ah , I must know him, something must happen between us . Sometimes , crush small inexplicable reasons . Possible only because a man's hand looks especially good-looking , but that day he used those hands come forward to give you their food , you'll love him for three days . May also be because of a man laughing demeanor particularly childish, a whole week you can not forget that face.

But the beginning , you do not know it was just three days , one week 's crush, you are holding yourself " beating" beating heart , think he nice , really unparalleled , really I am looking for a lifetime of people ah.

Then you began to imagine . There was a time , ranging from a few days to a few weeks, you live in the clouds . You fancy him see you. You imagine that you walk in the street , cross the road , he takes you by the hand , and then refused to let go . You imagine that you stay in the room , for the three hundred eighty kinds hugging posture , but still did not talk to each other speak words finished .

And so you put the fantasy fantasy finished, this will crush the fuel runs out .

Crush and love difference lies , had a chance to share fantasies into action , it has gone away . The reason it did not translate into action , perhaps because you're shy , embarrassed expression , and then accidentally miss out on this person. Perhaps it is because you do not have the "development" of opportunity, time or distance of space , so that the share of "heart" slowly suffocate from lack of oxygen . Perhaps it is because until the enemy came closer , you see his whole , his body the "bright spots" slowly being diluted his other shortcomings , so that feelings had a chance to sublimation , it has rotted down.

Love, it is a small animal , to raise it grows , the need to give it every day delicious drink , no action dribs and drabs , " feeding ", crush it so short-lived , and then dying down.

The other party may not even know you have " short , warm and shy love" him, and afterwards you may not recognize or do not believe they have " a short , warm and shy love" him , but it did have a short time , because this man, you happy. You Qiqiaoshengyan disowned lost three of five fall. You get rid of the earth and in the illusion of attraction soar .

Crush is the speed mortal . It 's cruel and beautiful in here.

When the crush trying to become a spark from a seed to take root when in reality , all the " fuss " began to appear : Oh, in fact, he seems to be quite sharp ...... "career" not very good ...... he kinda macho ...... do not look so good ...... then "responsibility" ah, "morality" ah, "family" ah, all worldly noise, start the name of " love " in the name , sneak crush, take it from corrosion whistle loudly into the bright an excessively bureaucratic soap opera.

Unfortunately, people always crush mistaken for love, corrupt share fantasies light. People can not wait in the light from that moment , pulling out a large section of the heavy story , finally overwhelmed by this heavy , bogged down , diehard .

However Lightning how it could be fixed ? C said that the face of some possibilities , turned away , is a beautiful mistake , but it went up , it is a stupid mistake .

So when the crush comes, indulge it, but without trying to grab it , put it into love at first forced them to forage . You can chin design that obviously can not happen in every detail : the debate with himself that the next time I saw him wearing clothes that say, that asked the question , which some eyes, at the same time you know that in fact deeply Next month, you'll forget him . Are you obsessed with this fantasy, but also stay in this fantasy . You looked at the hands of the Okanagan matches, so short, and slowly burn the fingertips, then turn off. Lit, you are thankful for the endless darkness short of that point , however bright flame.

Transfer Liu Yu blog

---------------------

In-depth understanding of American culture , I find some of this crush is worth playing . Very precise , but in our culture , but rare. Read so many romance novels , no one ever told me I should distinguish between crush and love: crush sudden fascination is short , and love is zhigenzhidi mind after two traffic and dependence.

Think about eighteen years of so much confusion, sometimes just crush nothing , but they thought it was a cup of love coming , the result is a tangle while caught them while also "I love how a man who has " issues . How I wish someone was able to jump out to me and said : "Oh , wake up the girl , it was just a crush."

It was just a crush. So you can fall fair and square , and in the wake of a banter with grateful hearts after back on the road , waiting for the arrival of true love . We can do anything that anyone brief lover, but always loyal lover waiting to do by far .

How To Save A WebPage As The PDF File

just copy your url in the input box: http://www.web2pdfconvert.com/

2013年10月10日星期四

Crusher Django Tutorial(7) About HTTP In Django

Cute and hate ADs: A suck website I made(For god sake help me click it or just ignore it.55555555)

Well, in this post, we will learn something about the HTTP Protocol which will be awesome!

As we know, the web app is based on the HTTP Protocol.HTPP Protocol is based on the TCP/IP Protocol which is the basic of the Internet.Basically, the Internet is just the routers and switchers to help us get the data from a server.Now, we just see what is the HTTP info in the Web layer.

In Django,we can use request.meta as a dictionary for store the available HTTP headers for the request from the clients.So what we need to do is just show the info in the dictionary, just using the HttpResponse()

Add the display_meta() function in the TomAndJerry views.py:

 

def display_meta(request):
    values = request.META.items()
    values.sort()
    html = []
    for k, v in values:
        html.append("<tr><td>%s</td><td>%s</td></tr>" % (k, v))
    return HttpResponse('<table>%s</table>' % '\n'.join(html))
 ;

Then, conf the urls.py as we learn before.But for now, we just want to use the template to make our page more beautiful.

Edit a template file in the folder templates named meta.html:

 
<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="/static/bootstarp.css" type="text/css" media="screen" title="no title" charset="utf-8" />
    <link rel="stylesheet" href="/static/table.css" type="text/css" media="screen" title="no title" charset="utf-8" />
    <title>META INFO FROM DJANGO</title>
</head>
<body>
 <h1>HTTP HEAD INFO</h1>
 {% if values %}
 <table class="table">
     <h2><caption>The info in the head:</caption></h2>
            {% for k, v in values %}
            <tr class="info">
                <td>{{ k }}</td>
                <td class="vinfo">{{ v }}</td>
            </tr>
            {% endfor %}
 </table>
 {% else %}
     <h2 class="error">Error</h2>
 {% endif %}
</body>
</html>
 

And we add a little css code for the table to show the info.

 
td {
 border: 1px solid green;
}
 

Now we re-edit the display_meta() views function:

 
def display_meta(request):
    values = request.META.items()
    values.sort()
    return render_to_response("meta.html", locals())
 

And don't forget to conf the urls.py elsewise you will get the 404 error which means no such page.

Now, we just test our info page:

LOL...It works.And can see a lot info.

Here is something important:

  • HTTP_HOST 127.0.0.1:8000 which show the server IP address and the port server use
  • HTTP_USER_AGENT Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.22 (KHTML, like Gecko) Ubuntu Chromium/25.0.1364.160 Chrome/25.0.1364.160 Safari/537.22 The USER_AGENT means the browser I use.
  • HTTP_COOKIE sessionid=8d2469b16fc859800c481ea613bf781b Which show the session id.It changes by the browser and computer.And it is a bit complex.
  • PWD /home/zoo/hello The current execute path we use.
  • PATH_INFO /display/ The file path we are in
  • REQUEST_METHOD GET The request method we use is get not post, it is not a form, usually we use post method in a form.
  • SERVER_NAME localhost The Server Name is localhost.
  • SERVER_PORT 8000 The Server port is 8000
  • SERVER_PROTOCOL HTTP/1.1 The Server Protocol we are using is HTTP1.1
Those are the basic info we should know.And if you want to know more about the HTTP Protocol, just find some network books to read it. I think this one is good at it.

Now, we can keep our eyes in the terminal:

 
[01/Oct/2013 08:57:26] "GET /display/ HTTP/1.1" 200 13373
[01/Oct/2013 08:57:26] "GET /static/bootstarp.css HTTP/1.1" 304 0
[01/Oct/2013 08:57:26] "GET /static/table.css HTTP/1.1" 304 0
 

From the basic log of django we can see our http request the first line means: Your browser said to the server: Hi I use the HTTP/1.1 protocol and want the content in display, just give me that!
Then, the lovely django will response it, he find the content(make the vars into the template) and give it back to your browser. The browser give the content and you will see it. And the 200 means everything is ok, you got want you want, everyone is happy.

But what is second line means? In HTTP protocol the 304 means when to deal with the static files like css js image files, the browser may store it in your last browse,if the files changed, it will download it again,if not changed just use the last version in your local file.The content is zero if nothing changed.

Well, if we just change the table.css like this and reflesh the page we have created:

 
td {
 border: 1px solid red;
}
 

From the terminal, it is the same result:

    
[01/Oct/2013 09:14:32] "GET /display/ HTTP/1.1" 200 13373
[01/Oct/2013 09:14:32] "GET /static/bootstarp.css HTTP/1.1" 304 0
[01/Oct/2013 09:14:32] "GET /static/table.css HTTP/1.1" 200 31
    

We can see that the browser request the table.css again beacuse it has been changed it the server sied.And the 13373 and 31 means the size of the file.And our table.css is 31 byte.

Now, we just do something using the terminal play as the browser,see what will happen.Just use the command :

    
zoo@ubuntu:~/桌面$ telnet localhost 8000
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
    

Type this line and Enter Button:

    
GET /display/ HTTP/1.1
    

And we also get the info from the server.Copy it to a html file and see it, we find that something is gone, such as the user_agent because we did not use it.

All right, the next post we will learn the Form in Django. And welcome to feedback if there is anything wrong in the posts.Thanks.