yasw 问题积累

1? .yasw文件输出源代码? 原因是notepad++显示所有字符发现 正常文件换行时cr+lf或只要lf

 异常文件不执行只输出源代码的文件每行末尾只有cr

 

2

 

3 yaws 购物例子  访问 /index.yasw 和 //index.yaws  的session不同

 

4 bad type  mnesia 插入数据时这个错误是因为

 

----  比如要求四列 四个字段,但是实际只填了两个字段  或:

----  有的列要求是原子但是插入的是字符串或list 等等 类型不一致,这时候要求进行list_to_atom等 转换

----  db创建错误 badtype  “e”   表名应该为原子,如果需要 list_to_atom("tablename")

----  [{record_name, AA},  {attributes, record_info(fields, BB)}                    record_name和record_info 的recode必须一致 AA必须和BB完全相同

----  mnesia:dirty_update_counter     {aborted,{combine_error,unique_id,update_counter}  ,unique_id表类型应该为默认set。其他类型就出这个错。

----表的创建不能放到事务里面!

---- 

---- 

---- 

 

5

 

5> list_to_existing_atom("1").
** exception error: bad argument
     in function  list_to_existing_atom/1
        called as list_to_existing_atom("1")
6> list_to_atom("1").
'1'

 

 

写程序反思时多参考:http://www.iteye.com/topic/374167

 

 

 

 

 

下面的问题也许要 

> unicode:characters_to_binary([36825]).
<<232,191,153>>

 

Yaws process died: {badarg,[{erlang,iolist_size,
                                    [[["HTTP/1.1 ","200"," ","OK","\r\n"],
                                      [[],
                                       ["Server: Yaws/","1.88",
                                        " Yet Another Web Server\r\n"],
                                       [],[],
                                       ["Date: ",
                                        ["Sun",", ","21"," ","Nov"," ","2010",
                                         " ","04",":","21",":","29"," ","GMT"],
                                        "\r\n"],
                                       [],[],[],[],
                                       ["Content-Length: ","29","\r\n"],
                                       ["Content-Type: ",
                                        "application/json; charset=utf-8",
                                        "\r\n"],
                                       [],[],[],[],[]],
                                      "\r\n",
                                      [[[91,
                                         [123,
                                          [[34,49,46,49,46,48,97,105,109,48,
                                            27721,23383 ,34],
                                           58,"\"detail0\""],
                                          125],
                                         93]],
                                       <<"\r\n">>]]]},
                            {yaws,gen_tcp_send,2},

 

 

2> erlang:iolist_size(
       [["HTTP/1.1 ","200"," ","OK","\r\n"],
         [[],
          ["Server: Yaws/","1.88",
           " Yet Another Web Server\r\n"],
          [],[],
          ["Date: ",
           ["Sun",", ","21"," ","Nov"," ","2010",
            " ","04",":","21",":","29"," ","GMT"],
           "\r\n"],
          [],[],[],[],
          ["Content-Length: ","29","\r\n"],
          ["Content-Type: ",
           "application/json; charset=utf-8",
           "\r\n"],
          [],[],[],[],[]],
         "\r\n",
         [[[91,
            [123,
             [[34,49,46,49,46,48,97,105,109,48,
               27721,23383,34],                                   有unicode就错误
              58,"\"detail0\""],
             125],
            93]],
          <<"\r\n">>]]).
** exception error: bad argument
     in function  iolist_size/1
        called as iolist_size([["HTTP/1.1 ","200"," ","OK","\r\n"],
                               [[],
                                ["Server: Yaws/","1.88",
                                 " Yet Another Web Server\r\n"],
                                [],[],
                                ["Date: ",
                                 ["Sun",", ","21"," ","Nov"," ","2010"," ",
                                  "04",":","21",":","29"," ","GMT"],
                                 "\r\n"],
                                [],[],[],[],
                                ["Content-Length: ","29","\r\n"],
                                ["Content-Type: ",
                                 "application/json; charset=utf-8","\r\n"],
                                [],[],[],[],[]],
                               "\r\n",
                               [[[91,
                                  [123,
                                   [[34,49,46,49,46,48,97,105,109,48,27721,
                                     23383,34],

                                    58,"\"detail0\""],
                                   125],
                                  93]],
                                <<"\r\n">>]])
3>           <<"\r\n">>]]).
* 1: syntax error before: ']'
3> erlang:iolist_size(
       [["HTTP/1.1 ","200"," ","OK","\r\n"],
         [[],
          ["Server: Yaws/","1.88",
           " Yet Another Web Server\r\n"],
          [],[],
          ["Date: ",
           ["Sun",", ","21"," ","Nov"," ","2010",
            " ","04",":","21",":","29"," ","GMT"],
           "\r\n"],
          [],[],[],[],
          ["Content-Length: ","29","\r\n"],
          ["Content-Type: ",
           "application/json; charset=utf-8",
           "\r\n"],
          [],[],[],[],[]],
         "\r\n",
         [[[91,
            [123,
             [[34,49,46,49,46,48,97,105,109,48,
               34],
              58,"\"detail0\""],
             125],
            93]],
          <<"\r\n">>]]).
192                                   去掉unicode就ok

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值