zoukankan      html  css  js  c++  java
  • 2019-9

    一、URL格式(Uniform Resource Locator,统一资源定位符)

      1、参考网址:访问带有用户名、密码保护的 URL

        格式:http://username:password@host:8080/directory/file?query#ref:

      2、参考书籍:《图解HTTP》第27页

       

        

    查询字符串:
    针对已指定的文件路径内的资源,可以使用查询字符串传入任意参数。此项可选。(这样可以在URL中直接下发参数和命令);
     
    3、HTTP协议
    浏览器输入URL,敲回车后,一般下发的是“GET”方法, 如:
    1)浏览器给restful_server:
    GET / HTTP/1.1
    
        Host: 192.168.22.190:8000
    
        User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36
    
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3
    
        Accept-Encoding: gzip, deflate
    
        Accept-Language: zh-CN,zh;q=0.9
    
        Proxy-Connection: keep-alive
    
        Upgrade-Insecure-Requests: 1
    
        X-Lantern-Version: 5.5.6
    
        
    

     2)restful_server给浏览器:

    HTTP/1.1 200 OK
    
        Server: Mongoose/6.15
    
        Date: Tue, 24 Sep 2019 10:51:51 GMT
    
        Last-Modified: Tue, 24 Sep 2019 08:11:13 GMT
    
        Accept-Ranges: bytes
    
        Content-Type: text/html
    
        Connection: keep-alive
    
        Content-Length: 1991
    
        Etag: "5d89cfa1.1991"
    
        
    
    
    <!DOCTYPE html>
    
        <html lang="en">
    
        <head>
    
          <meta charset="utf-8" />
    
          <title>RESTful API demo</title>
    
          <meta name="viewport" content="width=device-width, initial-scale=1" />
    
          <style type="text/css">
    
            * { outline: none; }
    
            body {
    
              background-color: #789; margin: 0;
    
              padding: 0; font: 16px/1.4 Helvetica, Arial, sans-serif;
    
              font: 16px/1.4 Helvetica, Arial, sans-serif;
    
            }
    
            div.content {
    
              width: 800px; margin: 2em auto; padding: 20px 50px;
    
              background-color: #fff; border-radius: 1em;
    
            }
    
            label { display: inline-block; min-width: 7em; }
    
            input { border: 1px solid #ccc; padding: 0.2em; }
    
            a:link, a:visited { color: #69c; text-decoration: none; }
    
            @media (max- 700px) {
    
              body { background-color: #fff; }
    
              div.content { width: auto; margin: 0 auto; padding: 1em; }
    
            }
    
        </style>
    
        
    
        <script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
    
        <script language="javascript" type="text/javascript">
    
          jQuery(function() {
    
        
    
            $(document).on('keyup', '#n1, #n2', function() {
    
              $.ajax({
    
                url: '/api/v1/sum',
    
                method: 'POST',
    
                dataType: 'json',
    
                data: { n1: $('#n1').val(), n2: $('#n2').val() },
    
                success: function(json) {
    
                  $('#result').html(json.result);
    
                }
    
              });
    
            });
    
        
    
          });
    
        </script>
    
        </head>
    
        <body>
    
          <div class="content">
    
            <h1>RESTful API demo.</h1>
    
        
    
            <p>
    
              This page demonstrates how Mongoose could be used to implement
    
              RESTful APIs. Start typing numbers into the text fields below.
    
              Browser sends two numbers to <tt>/api/v1/sum</tt> URI.
    
              Web server calclulates the sum and returns the result.
    
            </p>
    
        
    
            <div>
    
              <label>Number 1:</label> <input type="text" id="n1" />
    
            </div><div>
    
              <label>Number 2:</label> <input type="text" id="n2" />
    
            </div><div>
    
        	<!--
    
             <label>Result:</label> <span id="result">&nbsp;</span>
    
        	-->
    
            </div><div>
    
        	<label>Result:</label> <span id="result"></span>
    
        
    
          </div>
    
        </body>
    
        </html>
    

    二、linux下SVN不会自动输入密码的解决办法

      1、参考文档1:Linux下svn密码问题

      2、参考文档2:Linux下SVN账户密码保存设置

      3、如果按照上面的办法还无法解决问题,则使用终极大招,修改SVN的账号和密码文件,位置:~/.subversion/auth/svn.simple

        

     三、cjson

      1、参考网址:1:cJSON的源码下载(github)及使用说明

      2、参考网址2:cJSON的使用方法

    四、mongoose与resful server

      1、参考网址1:Mongoose搭建RESTful http/https web server

      2、参考网址2:使用mongoose实现restful server

    五、linux shell中的select与function

      1、参考网址1:shell编程——select语句

      2、参考网址2:Shell脚本中select、函数总结

    六、c语言

      1、#、##、...、__VA_ARGS__的区别与使用

        参考网址1:整理:C/C++可变参数,“## __VA_ARGS__”宏的介绍和使用

        参考网址2:GNU C语言 宏定义 #args ##args

        参考网址3:#、##、__VA_ARGS__和##__VA_ARGS__的作用

        总结:

        打印调试信息方法:

    GCC:  
    #define dbgprintf(format, args...)  fprintf(stdout, format, ##args)
        
    C99: 
    #define dbgprintf(fmt, ...)  printf(fmt, __VA_ARGS__)   #define dbgprintf(...)  printf(__VA_ARGS__)

    七、网页播放器

      1、参考网址1:使用Chrome打开http://www.cutv.com/demo/live_test.swf页面时swf文件自动下载问题

      

    八、linux

      1、参考网址1:/proc/uptime详解,获取系统启动时间,系统负载率

      2、参考网址2:Linux中/proc目录下文件详解

      3、参考网址3:linux驱动编写之poll机制

      4、参考网址4:[宏]_IO, _IOR, _IOW, _IOWR 宏的用法与解析

      5、参考网址5:Linux设备驱动之Ioctl控制

    九、SVN操作

      1、命令行svn commit时,注释怎么实现换行效果

        svn ci -m $'first line second line'   重点是单引号前的$

      2、SVN更新后,前边字母的提示含义

    U:表示从服务器收到文件更新了
    G:表示本地文件以及服务器文件都已更新,而且成功的合并了 
    A:表示有文件或者目录添加到工作目录
    R:表示文件或者目录被替换了.
    C:表示文件的本地修改和服务器修改发生冲突

     

  • 相关阅读:
    课堂测试-文本操作
    异常的总结
    动手动脑实验-异常
    从小工到专家-读后感3
    从小工到专家-读后感2
    从小工到专家-读后感1
    构建之法读书笔记(一)
    2.12日总结
    BaseAdapter的使用
    Activity之Bundle的使用
  • 原文地址:https://www.cnblogs.com/shanyu20/p/11498874.html
Copyright © 2011-2022 走看看