mathematica教程 不完整;需要更多输入.

【已解决】打开PayPal捐赠页面时出错:数据与输入的字符集或默认编码不符。如需更多信息,请联系商家。
期间,点击美元图标,打开PayPal捐赠页面,结果出错:
数据与输入的字符集或默认编码不符。如需更多信息,请联系商家。
目前我们无法处理您的申请。请返回,并尝试其他选项。
【解决过程】
1.回去仔细观察,看到个现象:
很明显,其中链接地址是不正常的:
即item_name中的值,显示异常。
对于当时用Python去quote地址的时候,估计是弄成了本地编码GBK的encode了,而不是UTF-8?
搞得是乱码了。所以人家PayPal不认是正常的。
2.所以回去看看,结果Python中对于urllib的quote的解释是:
urllib.quote(string[, safe])
Replace special characters in string using the %xx escape. Letters, digits, and the characters '_.-' are never quoted. By default, this function is intended for quoting the path section of the URL. The optional safe parameter specifies additional characters that should not be quoted — its default value is '/'.
Example: quote('/~connolly/') yields '/%7econnolly/'.
没有看到的,以为可以添加字符编码类型的参数。
3.所以另外想办法去encode地址,搜:
url encode
Crifan+Li%26%2339%3bs+Blog%
和之前Python的urllib.quote出来的:
Crifan%20Li%27s%20Blog%
很明显是不一样的
4.所以去试试这个:
Crifan+Li%26%2339%3bs+Blog%
(如果不行,再手动把(空格被编码后变成的)+换成%20)
即,之前的地址从:
&strong&&font color=&red&&捐赠(Donate):&/font&&/strong&
&a href=&/crifan& target=&_blank&&&img src=&/files/res/crifan_com/donate_icon_rmb_48x48.png& title=&给Crifan捐赠人民币& alt=&通过支付宝捐赠人民币& style=&border:vertical-align:& /&&/a&
&a href=&/cgi-bin/webscr?cmd=_xclick&business=green-&currency_code=USD&amount=1&item_name=Crifan%20Li%27s%20Blog%&undefined_quantity=1& target=&_blank&&&img src=&/files/res/crifan_com/donate_icon_dollar_48x48.png&
alt=&Donate dollar via paypal& title=&Donate dollar to Crifan& style=&border:vertical-align:& /&&/a&
&strong&&font color=&red&&捐赠(Donate):&/font&&/strong&
&a href=&/crifan& target=&_blank&&&img src=&/files/res/crifan_com/donate_icon_rmb_48x48.png& title=&给Crifan捐赠人民币& alt=&通过支付宝捐赠人民币& style=&border:vertical-align:& /&&/a&
&a href=&/cgi-bin/webscr?cmd=_xclick&business=green-&currency_code=USD&amount=1&item_name=Crifan+Li%26%2339%3bs+Blog%&undefined_quantity=1& target=&_blank&&&img src=&/files/res/crifan_com/donate_icon_dollar_48x48.png&
alt=&Donate dollar via paypal& title=&Donate dollar to Crifan& style=&border:vertical-align:& /&&/a&
可见,新的地址,也不太对,至少中间不该有那个39 0字样的。
5.然后重新换个别的:
去编码,得到结果是:
和Python得到的基本一样,除了空格变成+了。
然后对照人家阮一峰的:
Ruan%20YiFeng%27s%20Blog
其实可以确认:
Crifan%20Li%27s%20Blog%
应该就是对的,不应该错的。
但是需要找到,为何不知道哪里多出来个:
这三个中文。。
6.重新试试:
&strong&&font color=&red&&捐赠(Donate):&/font&&/strong&
&a href=&/crifan& target=&_blank&&&img src=&/files/res/crifan_com/donate_icon_rmb_48x48.png& title=&给Crifan捐赠人民币& alt=&通过支付宝捐赠人民币& style=&border:vertical-align:& /&&/a&
&a href=&/cgi-bin/webscr?cmd=_xclick&business=green-&currency_code=USD&amount=1&item_name=Crifan%20Li%27s%20Blog%&undefined_quantity=1& target=&_blank&&&img src=&/files/res/crifan_com/donate_icon_dollar_48x48.png&
alt=&Donate dollar via paypal& title=&Donate dollar to Crifan& style=&border:vertical-align:& /&&/a&
和之前一样,然后拷贝出来的url是:
/cgi-bin/webscr?cmd=_xclick&business=green-&currency_code=USD&amount=1&item_name=Crifani%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%E5%9C%A8%E8%B7%AF%E4%B8%8Alog%EF%&undefined_quantity=1
对比的看了下,才明白:
原来对于php代码:
/** Copyright Info */
function retina_post_copyright() {
$output = '';
$cur_post_custom_keys = get_post_custom_keys();
if (($cur_post_custom_keys==null) || !in_array('copyright', $cur_post_custom_keys)){
$mine_info = sprintf( '
&div class=&postcopyright&&
&fieldset&
&legend&防君子不防也无法防小人的声明&/legend&
如未注明转载等字样则均为crifan原创。对于原创文章,转载请注明出处:&br /&
&a href=&%1$s& title=&%2$s&&&strong&%3$s - %4$s&/strong&&/a&&br /&
本文链接: &br /&
&a target=&_blank& href=&%5$s& title=&%6$s&&%7$s&/a&
&strong&&font color=&red&&捐赠(Donate):&/font&&/strong&
&a href=&/crifan& target=&_blank&&&img src=&/files/res/crifan_com/donate_icon_rmb_48x48.png& title=&给Crifan捐赠人民币& alt=&通过支付宝捐赠人民币& style=&border:vertical-align:& /&&/a&
&a href=&/cgi-bin/webscr?cmd=_xclick&business=green-&currency_code=USD&amount=1&item_name=Crifan%20Li%27s%20Blog%&undefined_quantity=1& target=&_blank&&&img src=&/files/res/crifan_com/donate_icon_dollar_48x48.png&
alt=&Donate dollar via paypal& title=&Donate dollar to Crifan& style=&border:vertical-align:& /&&/a&
&/fieldset&
get_bloginfo('siteurl'), get_bloginfo('name'), get_bloginfo('name'), get_bloginfo('description'), get_permalink(), the_title_attribute( 'echo=0' ), the_title_attribute( 'echo=0' ));
$output = $mine_
$copyright_value = get_post_custom_values('copyright');
$other_info = sprintf( '
&div class=&postcopyright&&
&fieldset&
&legend&转载声明&/legend&
本文由crifan转载自:&br /&
&a target=&_blank& rel=&nofollow& href=&%1$s& &%2$s&/a&
本文链接:&br /&
&a href=&%3$s& title=&%4$s&&%5$s&/a&
&strong&&font color=&red&&捐赠(Donate):&/font&&/strong&
&a href=&/crifan& target=&_blank&&&img src=&/files/res/crifan_com/donate_icon_rmb_48x48.png& title=&给Crifan捐赠人民币& alt=&通过支付宝捐赠人民币& style=&border:vertical-align:& /&&/a&
&a href=&/cgi-bin/webscr?cmd=_xclick&business=green-&currency_code=USD&amount=1&item_name=Crifan%20Li%27s%20Blog%&undefined_quantity=1& target=&_blank&&&img src=&/files/res/crifan_com/donate_icon_dollar_48x48.png&
alt=&Donate dollar via paypal& title=&Donate dollar to Crifan& style=&border:vertical-align:& /&&/a&
&/fieldset&
$copyright_value[0], $copyright_value[0], get_permalink(), the_title_attribute( 'echo=0' ), the_title_attribute( 'echo=0' ));
$output = $other_
此处,被编码后的,空格被换成了%20的:
Crifan%20Li%27s%20Blog%
本来是没问题的,但是却由于放到了此处php函数中,导致%20被解析为第20个参数值了
(对应的,前面的%2$s,是title的值)
所以才出错的,由此得知:
此处,还是把空格换成+,就可以避免此问题了,所以去换为:
&strong&&font color=&red&&捐赠(Donate):&/font&&/strong&
&a href=&/crifan& target=&_blank&&&img src=&/files/res/crifan_com/donate_icon_rmb_48x48.png& title=&给Crifan捐赠人民币& alt=&通过支付宝捐赠人民币& style=&border:vertical-align:& /&&/a&
&a href=&/cgi-bin/webscr?cmd=_xclick&business=green-&currency_code=USD&amount=1&item_name=Crifan+Li%27s+Blog%&undefined_quantity=1& target=&_blank&&&img src=&/files/res/crifan_com/donate_icon_dollar_48x48.png&
alt=&Donate dollar via paypal& title=&Donate dollar to Crifan& style=&border:vertical-align:& /&&/a&
结果发现还是不行,因为其中还有单引号被编码后的%27呢。。。
所以,算了,打算去掉百分号,但是想到了:
估计php中,应该有办法输入%才对。估计是%%
然后通过:
php 函数 百分号
参数 format 是转换的格式,以百分比符号 (&%&) 开始到转换字符结束。下面的可能的 format 值:
%% – 返回百分比符号
%b – 二进制数
%c – 依照 ASCII 值的字符
%d – 带符号十进制数
%e – 可续计数法(比如 1.5e+3)
%u – 无符号十进制数
%f – 浮点数(local settings aware)
%F – 浮点数(not local settings aware)
%o – 八进制数
%s – 字符串
%x – 十六进制数(小写字母)
%X – 十六进制数(大写字母)
而得知我的猜测是对的,
所以,此时:
无需把之前的%20变成+了,也可以能够保留%27了,而只需要把%变成%%即可:
&strong&&font color=&red&&捐赠(Donate):&/font&&/strong&
&a href=&/crifan& target=&_blank&&&img src=&/files/res/crifan_com/donate_icon_rmb_48x48.png& title=&给Crifan捐赠人民币& alt=&通过支付宝捐赠人民币& style=&border:vertical-align:& /&&/a&
&a href=&/cgi-bin/webscr?cmd=_xclick&business=green-&currency_code=USD&amount=1&item_name=Crifan%%20Li%%27s%%20Blog%%3A%%&undefined_quantity=1& target=&_blank&&&img src=&/files/res/crifan_com/donate_icon_dollar_48x48.png&
alt=&Donate dollar via paypal& title=&Donate dollar to Crifan& style=&border:vertical-align:& /&&/a&
然后去试试效果:
最终PayPal的地址终于正常了:
自己把带空格和其他单引号等字符的字符串,通过encode编码后,结果会出现带%的,比如空格对应的%20和单引号对应的%27
然后把这样的内容,放到html中,其实是没问题,可以正常显示的;
但是由于此处的html是在php代码中,涉及到sprintf的
注:php的sprintf会通过%X去格式化字符串的
所以会错误的把%20和%27等内容去额外格式化,从而导致最终出来的html结果有问题。
解决办法就是:
对于在php的sprintf中的html,如果其中有%,则写成%%,即可避免此问题了。
2015年四月
13141516171819
20212223242526
免费的格式化Javascript源码的网站
查询Unicode字符,且还带Oct,Decimal,Hex,HTML Entity
HTML和Javascript都支持,很好用。对不定积分一题多解的分析_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
评价文档:
&&¥2.00
&&¥3.00
&&¥0.50
&&¥1.00
喜欢此文档的还喜欢
对不定积分一题多解的分析
不​定​积​分
阅读已结束,如果下载本文需要使用
想免费下载本文?
把文档贴到Blog、BBS或个人站等:
普通尺寸(450*500pix)
较大尺寸(630*500pix)
你可能喜欢关于mathematica,我的自定义函数怎么不能用_百度知道
关于mathematica,我的自定义函数怎么不能用
如这样一个函数?我觉得原因出在x后面的下划线那里了,-2?高手指教:f[x_]=x^2,2}]为什么老是提示出错;Plot[f[x],但不知道问什么,{x
这一种也不行。输入x的时候不是说两个都可以吗,是不是先点击书写板上的那个带右下角的符号?我试过了,然后再两部分里面分别输入x和下划线(数字9和等号后面的这个)
要再说这一种也不行了,没有问题的;Plot[f:= x^2, {x.第一种(第一行不是必须的:Remove[f]f[x_] ,但是用了第二种后:f = x^2;Plot[f[x],第一行的删除变量f就是必须写的), {x, -2, 2}]第二种, -2
其他类似问题
mathematica的相关知识
其他2条回答
接着立马运行这两行试试,就不会再出问题了可以肯定的是你用x或者f定义了其他变量了,请先运行Quit[]
直接从键盘输入嘛,何必点那个面板?f[x_]:=x^2;Plot[f[x],{x,-2,2}]
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁为什么Mathematic无法算出微积分按照教程上 命令是D[],但是我的就算不出来啊 下面一大堆错误指令 还有我的也无法加载更多的函数 哪位高人可以告知啊 我没有分了 不好意思~~_百度作业帮
为什么Mathematic无法算出微积分按照教程上 命令是D[],但是我的就算不出来啊 下面一大堆错误指令 还有我的也无法加载更多的函数 哪位高人可以告知啊 我没有分了 不好意思~~
按照教程上 命令是D[],但是我的就算不出来啊 下面一大堆错误指令 还有我的也无法加载更多的函数 哪位高人可以告知啊 我没有分了 不好意思~~
你应该把你的命令写出来,大家才好查出问题.Mathematica的新版本用f'[x]就可以求出f[x]的导数}

我要回帖

更多关于 mathematica矩阵输入 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信