Posts

Showing posts from February 13, 2019

UTF-8

Image
本条目 翻譯品質不佳。 翻譯者可能不熟悉中文或原文語言,也可能使用了機器翻譯,請協助翻譯本條目或重新編寫,并注意避免翻译腔的问题。 明顯拙劣 的機器翻譯請改掛 {{Delete|G13}} 提交刪除。 顯示了谷歌所記錄的2001年至2012年主要編碼的使用情況 [1] ,UTF-8在2008年超過了所有其他數據,2012年使用率接近50%。 UTF-8 ( 8-bit Unicode Transformation Format )是一種針對Unicode的可變長度字元編碼,也是一种前缀码。它可以用來表示Unicode標準中的任何字元,且其編碼中的第一個位元組仍與ASCII相容,這使得原來處理ASCII字元的軟體無須或只須做少部份修改,即可繼續使用。因此,它逐漸成為電子郵件、網頁及其他儲存或傳送文字優先採用的編碼。 UTF-8使用一至六個位元組為每個字符編碼(儘管如此,2003年11月UTF-8被RFC 3629重新規範,只能使用原来Unicode定義的區域,U+0000到U+10FFFF,也就是說最多四個字節): 128個US-ASCII字符只需一個位元組編碼(Unicode範圍由U+0000至U+007F)。 帶有附加符号的拉丁文、希臘文、西里爾字母、亞美尼亞語、希伯來文、阿拉伯文、敘利亞文及它拿字母則需要兩個位元組編碼(Unicode範圍由U+0080至U+07FF)。 其他基本多文種平面(BMP)中的字元(這包含了大部分常用字,如大部分的漢字)使用三個位元組編碼(Unicode範圍由U+0800至U+FFFF)。 其他極少使用的Unicode 輔助平面的字元使用四至六位元組編碼(Unicode範圍由U+10000至U+1FFFFF使用四字節,Unicode範圍由U+200000至U+3FFFFFF使用五字節,Unicode範圍由U+4000000至U+7FFFFFFF使用六字節)。 對上述提及的第四種字元而言,UTF-8使用四至六個位元組來編碼似乎太耗費資源了。但UTF-8對所有常用的字元都可以用三個位元組表示,而且它的另一種選擇,UTF-16編碼,對前述的第四種字符同樣需要四個位元組來編碼,所以要決定UTF-8或UTF-16哪種編碼比較有效率,還要視所使用的字元的分佈範圍而定。不過,如果使用一些傳統的壓縮系統,

Looking for where I went wrong: Finding the volume of a solid that lies within both a cylinder and sphere

Image
4 $begingroup$ I'm currently working on this question: Find the volume of the solid that lies within both the cylinder $x^2+y^2=1$ and the sphere $x^2+y^2+z^2=4$ . I decided to use polar coordinates so that the cylinder equation becomes $r^2=1$ and the sphere becomes $r^2+z^2=4$ . Solving for $z$ , I get the inequality $-sqrt{4-r^2}leq zleq sqrt{4-r^2}$ . Since I know what $r^2$ is, I plug that in to get the inequality where $z$ is between $-sqrt{3}$ and $sqrt{3}$ . Combining that to make a triple integral, I get: $int_0^{2pi}int_0^1int_{-sqrt{3}}^sqrt{3}rdzdrdtheta$ However, Slader has a different answer where they didn't plug in $sqrt{3}$ into the bounds. Why does plugging in the value for $r^2$ make the calculation wrong? Isn't $r^2$ always $1$ ?