<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.secondlife.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pedro+Oval</id>
	<title>Second Life Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.secondlife.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pedro+Oval"/>
	<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/wiki/Special:Contributions/Pedro_Oval"/>
	<updated>2026-07-02T01:35:14Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Talk:LlDialog&amp;diff=1200587</id>
		<title>Talk:LlDialog</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Talk:LlDialog&amp;diff=1200587"/>
		<updated>2016-07-02T21:14:20Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: /* Concurreny issue in first code sample (edited) */ More &amp;lt;lsl&amp;gt; tag replacement&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Button Length Issues ==&lt;br /&gt;
Telling an end user that the max length of a button label is 24 bytes ... well, not overly helpful. But there is the problem of what what characters translate to how many bytes. Still, is there any way we can give examples of characters?&lt;br /&gt;
&lt;br /&gt;
[[User:Chaz Longstaff|Chaz Longstaff]] 05:18, 27 November 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
: Can you use a function like this to find long strings? Then the user will not have to guess what button is bad Somebody check my work please, I am sleepy as always.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;integer GetStringBytes(string s) {&lt;br /&gt;
    list chopped = llParseString2List(llEscapeURL(&amp;quot;*&amp;quot; + s), [&amp;quot;%&amp;quot;], []);&lt;br /&gt;
    return llStringLength((string)chopped) - llGetListLength(chopped) - 1;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
:--[[User:Cerise Sorbet|Cerise Sorbet]] 10:03, 27 November 2009 (UTC)&lt;br /&gt;
:: I was too sleepy. Maybe this time. --[[User:Cerise Sorbet|Cerise Sorbet]] 11:06, 27 November 2009 (UTC)&lt;br /&gt;
:: Maybe this one will be more nice to memory? --[[User:Cerise Sorbet|Cerise Sorbet]] 13:03, 27 November 2009 (UTC)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;integer GetStringBytes2(string s) {&lt;br /&gt;
    s = llEscapeURL(s);&lt;br /&gt;
    integer i = 0;&lt;br /&gt;
    integer j;&lt;br /&gt;
    for (j = llStringLength(s); j &amp;gt; -1; j--)&lt;br /&gt;
        i += (llGetSubString(s, j, j) == &amp;quot;%&amp;quot;);&lt;br /&gt;
    return llStringLength(s) - i - i;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Strife, Chaz here. Most ordinary users in SL, and most user documentation in SL, refer to dialog boxes in SL as menus. While that may be as technically inaccurate as referring to a tomato as a vegetable, people don&#039;t look for tomatoes in between the apples and bananas at their green grocer (grin), and they are going to come here looking for info on menus, not dialogue boxes. I think we need to at least acknowledge the word menu, even if we do correct them about its usage right away. (I also dislike how people use the word less when they should be using fewer, but that is also just the way it is, sadly :} )[[User:Chaz Longstaff|Chaz Longstaff]] 18:17, 15 July 2008 (PDT)&lt;br /&gt;
&lt;br /&gt;
:Very good point. I&#039;ll also keep a lookout for improper uses of &amp;quot;less&amp;quot;. -- [[User:Strife Onizuka|Strife Onizuka]] 18:32, 15 July 2008 (PDT)&lt;br /&gt;
&lt;br /&gt;
The Wiki mentions that clicking on a button causes the value to be chatted on the specified channel, but doesn&#039;t clarify whether it&#039;s simply said(llSay) or shouted(llShout).  It does mention that errors will be shouted on the Debug Channel, but I think it&#039;s important to clarify this within the Wiki.&lt;br /&gt;
--{{User|Deimos Damone}}&lt;br /&gt;
&lt;br /&gt;
:I have reworded the applicable caveat to clarify the functionality. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 11:49, 15 October 2008 (PDT)&lt;br /&gt;
&lt;br /&gt;
It may be worth including some explicit explanation of the difference between bytes and unicode characters, especially since the inworld error messages somewhat ambiguously talk about characters, when in fact referring to bytes. -- [[User:Tali Rosca|Tali Rosca]] 10:45, 15 October 2008 (PDT)&lt;br /&gt;
&lt;br /&gt;
:Many functions use byte limits and not character limits. I think it would be better to make the word &amp;quot;byte&amp;quot; a link to a (new?) subsection of the [[string]] article where that can be better addressed. It would be inappropriate to duplicate this information on multiple articles, it would end up clogging the articles. That said, I&#039;ll try to find the best method for presenting this information; as you point out the current caveat is inadequate and more information is needed. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 11:49, 15 October 2008 (PDT)&lt;br /&gt;
&lt;br /&gt;
::I agree that the actual explanation shouldn&#039;t be here, but a link should be fairly prominent, since this is the most likely place people will run into the difference. [[User:Tali Rosca|Tali Rosca]] 12:03, 15 October 2008 (PDT)&lt;br /&gt;
&lt;br /&gt;
the current suggested function for &amp;quot;safely&amp;quot; truncating button text length is not safe... it can break across a multibyte character&amp;lt;br/&amp;gt;-- &#039;&#039;&#039;[[User:Void_Singer|Void]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: It says it &amp;quot;can be used to truncate the string without giving an error&amp;quot;. Can you produce any errors due to button length or otherwise, when using it? Usually, if LSL in general, and llBase64ToString in particular in this case, finds an incorrect or incomplete UTF-8 character, it will replace that character with a question mark, and no error will be given. Is that not what you see?&lt;br /&gt;
: Thanks for fixing the number, by the way. --[[User:Pedro Oval|Pedro Oval]] ([[User talk:Pedro Oval|talk]]) 14:13, 2 July 2016 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Multiple dialogs tips ==&lt;br /&gt;
&lt;br /&gt;
It may worth mention in tips.&lt;br /&gt;
&lt;br /&gt;
Sending multiple dialogs in a row to one avatar may be inappropriate. In old viewer it creates stack of messages in notification area, which complicates reading other things. In viewer version 2 (as of 16/Sep/2010) newer dialogs replace unanswered dialogs from the same object, so any information and chance to react is lost.&lt;br /&gt;
&lt;br /&gt;
If you need to present more than 12 options, add buttons for browsing option pages (see [[SimpleDialogMenuSystem]]).&lt;br /&gt;
&lt;br /&gt;
If dialogs are not requested by user, but rather are triggered by some events, you may want to either queue further events or discard them until the first dialog will be answered, or at least throttle them. In any case, if you are sending many dialogs, there should be an option to stop them. (Making user mute your object is bad because he may then forget to unmute it when he will want to interact with the object again).&lt;br /&gt;
&lt;br /&gt;
If you just need to report something that does not require an answer, consider using other means of communication. Though, you may still want to send one dialog to draw user&#039;s attention.&lt;br /&gt;
&lt;br /&gt;
[[User:Wicked Winslet|Wicked Winslet]] 12:25, 16 September 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
the first example is very likely to stop working over time with a &amp;quot;too many listens&amp;quot; error in a multi-user environment. Cause: any user that clicks on the object will generate a new listen handle, but only the last one is saved, so only the last one is closed. any user (including the current) that touches the prim before the current user has clicked on a dialog response (or within 60seconds if they do not, or click cancel on the dialog) will cause the current open listen handle to advance, and the previous one will never be closed.&amp;lt;br/&amp;gt;-- &#039;&#039;&#039;[[User:Void_Singer|Void]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 12:03, 13 January 2013 (PST)&lt;br /&gt;
:: I suspect the prim will have died long before that LOL. But you have a point [[User:Omei Qunhua|Omei Qunhua]] 13:47, 13 January 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
:: In fact it would have to be clicked by 65 different users all choosing to ignore the dialog. A subsequent listen using the same filters as a previous is assigned to the same handle. (Thanks Pedro and Innula) [[User:Omei Qunhua|Omei Qunhua]] 10:30, 14 January 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
Also in the first example, the call to llDialog() happens before the listen is created. In my experience it&#039;s possible for this to result in a situation where the dialog is shown to the user and, if they click fast enough, the reply is lost. Might it be a good idea to do it the other way round? [[User:Antony Fairport|Antony Fairport]] 05:29, 16 January 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
:: Wow, you type fast! I couldn&#039;t even move my mouse onto the dialog window that fast. Anyway I changed it. Example #2 had the same remote possibility of accumulating active listeners, I believe.  [[User:Omei Qunhua|Omei Qunhua]] 08:10, 16 January 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
::: Admittedly it&#039;s unlikely to be an issue with that actual example but it&#039;s possible that a dialog that spawns a dialog that spawns a dialog... (etc) will have someone camping on a button and a reply can get missed. So I was just thinking it might be an idea to encourage starting the listen fist. [[User:Antony Fairport|Antony Fairport]] 08:25, 16 January 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
== Where&#039;s order_buttons? ==&lt;br /&gt;
Didn&#039;t there used to be an example of that very useful helper function, order_buttons(), on this page? Unless there was a particular reason for removing it, I think it would be good to have it back. [[User:Innula Zenovka|Innula Zenovka]] 11:27, 18 February 2013 (PST)&lt;br /&gt;
: It&#039;s back, a name collision hid it. --[[User:ObviousAltIsObvious Resident|ObviousAltIsObvious Resident]] 12:11, 18 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
== Concurreny issue in first code sample (edited) ==&lt;br /&gt;
&lt;br /&gt;
The first code sample has the following fundamental problem (as can be easily demonstrated): at any point in time there can be &#039;&#039;&#039;multiple&#039;&#039;&#039; listeners attached because any number of users can click on the prim. But the script sample has only &#039;&#039;&#039;one&#039;&#039;&#039; global variable to keep track of it. Result: The last user to click on the prim &amp;quot;wins&amp;quot; in the sense that whoever closes the dialog first will remove his listener. All other listeners will remain active.&lt;br /&gt;
&lt;br /&gt;
The obvious mediation is &lt;br /&gt;
# either to introduce a more sophisticated listener tracking (and most likely some form of polling in a regular timer event) &lt;br /&gt;
# or to keep it simple and introduce a single static listener, omitting the need for a timer event altogether.&lt;br /&gt;
&lt;br /&gt;
I personally opt for the latter. If there are no objections I can make those changes. Proposal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// When the prim is touched, give the toucher the option of killing the prim.&lt;br /&gt;
 &lt;br /&gt;
integer gListener;     // Identity of the listener associated with the dialog, so we can clean up when not needed&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
	// Set up a listener for potential llDialog() calls&lt;br /&gt;
        // it might seem like a waste at this stage, but overall it is way more efficient&lt;br /&gt;
	// than trying to track listeners on a per-user basis&lt;br /&gt;
        gListener = llListen(-99, &amp;quot;&amp;quot;, NULL_KEY, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // get the UUID of the person touching this prim&lt;br /&gt;
        key user = llDetectedKey(0);&lt;br /&gt;
        // Send a dialog to that person. We&#039;ll use a fixed negative channel number for simplicity&lt;br /&gt;
        llDialog(user, &amp;quot;\nDo you wish this prim to die?&amp;quot;, [&amp;quot;Yes&amp;quot;, &amp;quot;No&amp;quot; ] , -99);&lt;br /&gt;
    }&lt;br /&gt;
    listen(integer chan, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        // If the user clicked the &amp;quot;Yes&amp;quot; button, kill this prim.&lt;br /&gt;
        if (msg == &amp;quot;Yes&amp;quot;)&lt;br /&gt;
            llDie();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Btw, the same fundamental flaw is present in the tutorial https://wiki.secondlife.com/wiki/Dialog_Menus .&lt;br /&gt;
&lt;br /&gt;
Edit: the second code sample contains the flaw, too&lt;br /&gt;
&lt;br /&gt;
--[[User:LovingAndRejected Resident|LovingAndRejected Resident]] 05:37, 13 November 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
: I&#039;m not seeing where the multiple listens will come from given that the touch event (in the first sample on this page) removes any previous listen. [[User:Antony Fairport|Antony Fairport]] 08:42, 13 November 2013 (PST)&lt;br /&gt;
: Agreed. llListenRemove(gListener) will close any pre-existing instance of gListener.  Because a dialog box will never self-cancel and we have no way to detect whether a user has clicked &amp;quot;Ignore&amp;quot;, it is necessary  to include a timer that will remove the listen handle as well.[[User:Rolig Loon|Rolig Loon]] 09:06 13 November 2013 (PST)&lt;br /&gt;
: Your understanding of the examples is incomplete. As written, they do close any possible open listeners before registering another. Note the first line within the touch_start() event handler of the first example, which is commented to that effect, and the call to close_menu() in the second.&lt;br /&gt;
: Your proposed change goes against the preferred practice of only opening a listener when required and then closing it immediately afterwards. The (still present under Mono) overhead involved with each and every open listener on a sim should be considered by the scripter. [[User:LepreKhaun Resident|LepreKhaun Resident]] 09:24, 13 November 2013 (PST)&lt;br /&gt;
:Ahhh, I now see that there &#039;&#039;&#039;is&#039;&#039;&#039; a problem with the page though! It does imply that listeners are being registered by the &#039;&#039;&#039;llDialog();&#039;&#039;&#039; call by not explicitly stating that the function merely opens a dialog menu and it is &#039;&#039;&#039;llListen();&#039;&#039;&#039; which opens the listener. That is confusing and should be corrected imo. [[User:LepreKhaun Resident|LepreKhaun Resident]] 10:38, 13 November 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
I agree that my initial analysis was wrong in that the wiki code will remove the listener for a previously created listener belonging to another user in the touch event. Therefore the issue of multiple open listeners will not occur. Instead the dialog will go dumb on the other users. If people think that is acceptable for sample code I retract my motion to change it. [[User:LovingAndRejected Resident|LovingAndRejected Resident]] 11:40, 13 November 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
Multi-user concurrency is a big annoying issue complicated by the limit on resources (listens &amp;amp; memory), it&#039;s not easy to do so most systems just don&#039;t allow it. If you don&#039;t mind insecurity and instability, concurrency can be quite easy. Listen-concurrency is really too specialized and complex a topic for llDialog, it really needs it&#039;s own page. It might be fun, I&#039;ll look into writing about how to do it. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 23:54, 13 November 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
:what strife said as far as concurrency being hairy. If you check out the helper function [[User:Void_Singer/Functions#uDlgBtnPagList]] that I added to the page a while back, you&#039;ll see that one way to avoid the concurrency issue is to ignore the conventional wisdom about closing listens, and fitering them in the listen, and instead use a single always on listen, and filter by user key as provided from within the listen event... it&#039;s not ideal in all ways (I don&#039;t recommend it for mass use of multiple objects in a single area) but it does make unlimited concurrency possible on a single listen. It also results in needing to do more script work per request to filter, but if you need concurrency, it is an option. knowing Strife, it&#039;ll be torn apart and something even better will be created from it = D &amp;lt;br/&amp;gt;-- &#039;&#039;&#039;[[User:Void_Singer|Void]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 14:21, 14 November 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
::That&#039;s a great solution for static content. I really like it. You could use something besides spaces to store more complex state info. I was thinking something more complex, tailored listens and release them as needed. The advantage of tailored listens is that you don&#039;t have to worry about parsing 3rd party messages but it comes at a slight performance cost of having to track listen handles. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 21:14, 14 November 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
== False ignore buttons ==&lt;br /&gt;
&lt;br /&gt;
The article says, &amp;quot;If a button is named &amp;lt;code&amp;gt;[&amp;quot;Ignore&amp;quot;]&amp;lt;/code&amp;gt;, it will behave like the small &amp;lt;code&amp;gt;[&amp;quot;Ignore&amp;quot;]&amp;lt;/code&amp;gt; button of the menu&amp;quot;.  I just tested that, and it didn&#039;t happen for me.  Is it viewer-dependent?  I&#039;m on Firestorm 4.6.5. --[[User:Brilliand Resident|Brilliand Resident]] 20:06, 18 August 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
: This was fixed in 2012, with [[Release Notes/Second Life Release/3.3.1|SL viewer 3.3.1]] and third party viewers based on it.  The issue was {{Jira|STORM-1718}}. Some viewers, especially those that keep a V1-style interface (Singularity, Cool VL), could still have the old behavior and should be tested. --[[User:ObviousAltIsObvious Resident|ObviousAltIsObvious Resident]] 20:35, 18 August 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
:: Documented. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 13:21, 20 August 2014 (PDT)&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Talk:LlDialog&amp;diff=1200586</id>
		<title>Talk:LlDialog</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Talk:LlDialog&amp;diff=1200586"/>
		<updated>2016-07-02T21:13:06Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: /* Button Length Issues */ Reply to Void (and replace obsolete &amp;lt;lsl&amp;gt; tags while on it)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Button Length Issues ==&lt;br /&gt;
Telling an end user that the max length of a button label is 24 bytes ... well, not overly helpful. But there is the problem of what what characters translate to how many bytes. Still, is there any way we can give examples of characters?&lt;br /&gt;
&lt;br /&gt;
[[User:Chaz Longstaff|Chaz Longstaff]] 05:18, 27 November 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
: Can you use a function like this to find long strings? Then the user will not have to guess what button is bad Somebody check my work please, I am sleepy as always.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;integer GetStringBytes(string s) {&lt;br /&gt;
    list chopped = llParseString2List(llEscapeURL(&amp;quot;*&amp;quot; + s), [&amp;quot;%&amp;quot;], []);&lt;br /&gt;
    return llStringLength((string)chopped) - llGetListLength(chopped) - 1;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
:--[[User:Cerise Sorbet|Cerise Sorbet]] 10:03, 27 November 2009 (UTC)&lt;br /&gt;
:: I was too sleepy. Maybe this time. --[[User:Cerise Sorbet|Cerise Sorbet]] 11:06, 27 November 2009 (UTC)&lt;br /&gt;
:: Maybe this one will be more nice to memory? --[[User:Cerise Sorbet|Cerise Sorbet]] 13:03, 27 November 2009 (UTC)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;integer GetStringBytes2(string s) {&lt;br /&gt;
    s = llEscapeURL(s);&lt;br /&gt;
    integer i = 0;&lt;br /&gt;
    integer j;&lt;br /&gt;
    for (j = llStringLength(s); j &amp;gt; -1; j--)&lt;br /&gt;
        i += (llGetSubString(s, j, j) == &amp;quot;%&amp;quot;);&lt;br /&gt;
    return llStringLength(s) - i - i;&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
Strife, Chaz here. Most ordinary users in SL, and most user documentation in SL, refer to dialog boxes in SL as menus. While that may be as technically inaccurate as referring to a tomato as a vegetable, people don&#039;t look for tomatoes in between the apples and bananas at their green grocer (grin), and they are going to come here looking for info on menus, not dialogue boxes. I think we need to at least acknowledge the word menu, even if we do correct them about its usage right away. (I also dislike how people use the word less when they should be using fewer, but that is also just the way it is, sadly :} )[[User:Chaz Longstaff|Chaz Longstaff]] 18:17, 15 July 2008 (PDT)&lt;br /&gt;
&lt;br /&gt;
:Very good point. I&#039;ll also keep a lookout for improper uses of &amp;quot;less&amp;quot;. -- [[User:Strife Onizuka|Strife Onizuka]] 18:32, 15 July 2008 (PDT)&lt;br /&gt;
&lt;br /&gt;
The Wiki mentions that clicking on a button causes the value to be chatted on the specified channel, but doesn&#039;t clarify whether it&#039;s simply said(llSay) or shouted(llShout).  It does mention that errors will be shouted on the Debug Channel, but I think it&#039;s important to clarify this within the Wiki.&lt;br /&gt;
--{{User|Deimos Damone}}&lt;br /&gt;
&lt;br /&gt;
:I have reworded the applicable caveat to clarify the functionality. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 11:49, 15 October 2008 (PDT)&lt;br /&gt;
&lt;br /&gt;
It may be worth including some explicit explanation of the difference between bytes and unicode characters, especially since the inworld error messages somewhat ambiguously talk about characters, when in fact referring to bytes. -- [[User:Tali Rosca|Tali Rosca]] 10:45, 15 October 2008 (PDT)&lt;br /&gt;
&lt;br /&gt;
:Many functions use byte limits and not character limits. I think it would be better to make the word &amp;quot;byte&amp;quot; a link to a (new?) subsection of the [[string]] article where that can be better addressed. It would be inappropriate to duplicate this information on multiple articles, it would end up clogging the articles. That said, I&#039;ll try to find the best method for presenting this information; as you point out the current caveat is inadequate and more information is needed. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 11:49, 15 October 2008 (PDT)&lt;br /&gt;
&lt;br /&gt;
::I agree that the actual explanation shouldn&#039;t be here, but a link should be fairly prominent, since this is the most likely place people will run into the difference. [[User:Tali Rosca|Tali Rosca]] 12:03, 15 October 2008 (PDT)&lt;br /&gt;
&lt;br /&gt;
the current suggested function for &amp;quot;safely&amp;quot; truncating button text length is not safe... it can break across a multibyte character&amp;lt;br/&amp;gt;-- &#039;&#039;&#039;[[User:Void_Singer|Void]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: It says it &amp;quot;can be used to truncate the string without giving an error&amp;quot;. Can you produce any errors due to button length or otherwise, when using it? Usually, if LSL in general, and llBase64ToString in particular in this case, finds an incorrect or incomplete UTF-8 character, it will replace that character with a question mark, and no error will be given. Is that not what you see?&lt;br /&gt;
: Thanks for fixing the number, by the way. --[[User:Pedro Oval|Pedro Oval]] ([[User talk:Pedro Oval|talk]]) 14:13, 2 July 2016 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Multiple dialogs tips ==&lt;br /&gt;
&lt;br /&gt;
It may worth mention in tips.&lt;br /&gt;
&lt;br /&gt;
Sending multiple dialogs in a row to one avatar may be inappropriate. In old viewer it creates stack of messages in notification area, which complicates reading other things. In viewer version 2 (as of 16/Sep/2010) newer dialogs replace unanswered dialogs from the same object, so any information and chance to react is lost.&lt;br /&gt;
&lt;br /&gt;
If you need to present more than 12 options, add buttons for browsing option pages (see [[SimpleDialogMenuSystem]]).&lt;br /&gt;
&lt;br /&gt;
If dialogs are not requested by user, but rather are triggered by some events, you may want to either queue further events or discard them until the first dialog will be answered, or at least throttle them. In any case, if you are sending many dialogs, there should be an option to stop them. (Making user mute your object is bad because he may then forget to unmute it when he will want to interact with the object again).&lt;br /&gt;
&lt;br /&gt;
If you just need to report something that does not require an answer, consider using other means of communication. Though, you may still want to send one dialog to draw user&#039;s attention.&lt;br /&gt;
&lt;br /&gt;
[[User:Wicked Winslet|Wicked Winslet]] 12:25, 16 September 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
the first example is very likely to stop working over time with a &amp;quot;too many listens&amp;quot; error in a multi-user environment. Cause: any user that clicks on the object will generate a new listen handle, but only the last one is saved, so only the last one is closed. any user (including the current) that touches the prim before the current user has clicked on a dialog response (or within 60seconds if they do not, or click cancel on the dialog) will cause the current open listen handle to advance, and the previous one will never be closed.&amp;lt;br/&amp;gt;-- &#039;&#039;&#039;[[User:Void_Singer|Void]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 12:03, 13 January 2013 (PST)&lt;br /&gt;
:: I suspect the prim will have died long before that LOL. But you have a point [[User:Omei Qunhua|Omei Qunhua]] 13:47, 13 January 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
:: In fact it would have to be clicked by 65 different users all choosing to ignore the dialog. A subsequent listen using the same filters as a previous is assigned to the same handle. (Thanks Pedro and Innula) [[User:Omei Qunhua|Omei Qunhua]] 10:30, 14 January 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
Also in the first example, the call to llDialog() happens before the listen is created. In my experience it&#039;s possible for this to result in a situation where the dialog is shown to the user and, if they click fast enough, the reply is lost. Might it be a good idea to do it the other way round? [[User:Antony Fairport|Antony Fairport]] 05:29, 16 January 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
:: Wow, you type fast! I couldn&#039;t even move my mouse onto the dialog window that fast. Anyway I changed it. Example #2 had the same remote possibility of accumulating active listeners, I believe.  [[User:Omei Qunhua|Omei Qunhua]] 08:10, 16 January 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
::: Admittedly it&#039;s unlikely to be an issue with that actual example but it&#039;s possible that a dialog that spawns a dialog that spawns a dialog... (etc) will have someone camping on a button and a reply can get missed. So I was just thinking it might be an idea to encourage starting the listen fist. [[User:Antony Fairport|Antony Fairport]] 08:25, 16 January 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
== Where&#039;s order_buttons? ==&lt;br /&gt;
Didn&#039;t there used to be an example of that very useful helper function, order_buttons(), on this page? Unless there was a particular reason for removing it, I think it would be good to have it back. [[User:Innula Zenovka|Innula Zenovka]] 11:27, 18 February 2013 (PST)&lt;br /&gt;
: It&#039;s back, a name collision hid it. --[[User:ObviousAltIsObvious Resident|ObviousAltIsObvious Resident]] 12:11, 18 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
== Concurreny issue in first code sample (edited) ==&lt;br /&gt;
&lt;br /&gt;
The first code sample has the following fundamental problem (as can be easily demonstrated): at any point in time there can be &#039;&#039;&#039;multiple&#039;&#039;&#039; listeners attached because any number of users can click on the prim. But the script sample has only &#039;&#039;&#039;one&#039;&#039;&#039; global variable to keep track of it. Result: The last user to click on the prim &amp;quot;wins&amp;quot; in the sense that whoever closes the dialog first will remove his listener. All other listeners will remain active.&lt;br /&gt;
&lt;br /&gt;
The obvious mediation is &lt;br /&gt;
# either to introduce a more sophisticated listener tracking (and most likely some form of polling in a regular timer event) &lt;br /&gt;
# or to keep it simple and introduce a single static listener, omitting the need for a timer event altogether.&lt;br /&gt;
&lt;br /&gt;
I personally opt for the latter. If there are no objections I can make those changes. Proposal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// When the prim is touched, give the toucher the option of killing the prim.&lt;br /&gt;
 &lt;br /&gt;
integer gListener;     // Identity of the listener associated with the dialog, so we can clean up when not needed&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
	// Set up a listener for potential llDialog() calls&lt;br /&gt;
        // it might seem like a waste at this stage, but overall it is way more efficient&lt;br /&gt;
	// than trying to track listeners on a per-user basis&lt;br /&gt;
        gListener = llListen(-99, &amp;quot;&amp;quot;, NULL_KEY, &amp;quot;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    touch_start(integer total_number)&lt;br /&gt;
    {&lt;br /&gt;
        // get the UUID of the person touching this prim&lt;br /&gt;
        key user = llDetectedKey(0);&lt;br /&gt;
        // Send a dialog to that person. We&#039;ll use a fixed negative channel number for simplicity&lt;br /&gt;
        llDialog(user, &amp;quot;\nDo you wish this prim to die?&amp;quot;, [&amp;quot;Yes&amp;quot;, &amp;quot;No&amp;quot; ] , -99);&lt;br /&gt;
    }&lt;br /&gt;
    listen(integer chan, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        // If the user clicked the &amp;quot;Yes&amp;quot; button, kill this prim.&lt;br /&gt;
        if (msg == &amp;quot;Yes&amp;quot;)&lt;br /&gt;
            llDie();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Btw, the same fundamental flaw is present in the tutorial https://wiki.secondlife.com/wiki/Dialog_Menus .&lt;br /&gt;
&lt;br /&gt;
Edit: the second code sample contains the flaw, too&lt;br /&gt;
&lt;br /&gt;
--[[User:LovingAndRejected Resident|LovingAndRejected Resident]] 05:37, 13 November 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
: I&#039;m not seeing where the multiple listens will come from given that the touch event (in the first sample on this page) removes any previous listen. [[User:Antony Fairport|Antony Fairport]] 08:42, 13 November 2013 (PST)&lt;br /&gt;
: Agreed. llListenRemove(gListener) will close any pre-existing instance of gListener.  Because a dialog box will never self-cancel and we have no way to detect whether a user has clicked &amp;quot;Ignore&amp;quot;, it is necessary  to include a timer that will remove the listen handle as well.[[User:Rolig Loon|Rolig Loon]] 09:06 13 November 2013 (PST)&lt;br /&gt;
: Your understanding of the examples is incomplete. As written, they do close any possible open listeners before registering another. Note the first line within the touch_start() event handler of the first example, which is commented to that effect, and the call to close_menu() in the second.&lt;br /&gt;
: Your proposed change goes against the preferred practice of only opening a listener when required and then closing it immediately afterwards. The (still present under Mono) overhead involved with each and every open listener on a sim should be considered by the scripter. [[User:LepreKhaun Resident|LepreKhaun Resident]] 09:24, 13 November 2013 (PST)&lt;br /&gt;
:Ahhh, I now see that there &#039;&#039;&#039;is&#039;&#039;&#039; a problem with the page though! It does imply that listeners are being registered by the &#039;&#039;&#039;llDialog();&#039;&#039;&#039; call by not explicitly stating that the function merely opens a dialog menu and it is &#039;&#039;&#039;llListen();&#039;&#039;&#039; which opens the listener. That is confusing and should be corrected imo. [[User:LepreKhaun Resident|LepreKhaun Resident]] 10:38, 13 November 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
I agree that my initial analysis was wrong in that the wiki code will remove the listener for a previously created listener belonging to another user in the touch event. Therefore the issue of multiple open listeners will not occur. Instead the dialog will go dumb on the other users. If people think that is acceptable for sample code I retract my motion to change it. [[User:LovingAndRejected Resident|LovingAndRejected Resident]] 11:40, 13 November 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
Multi-user concurrency is a big annoying issue complicated by the limit on resources (listens &amp;amp; memory), it&#039;s not easy to do so most systems just don&#039;t allow it. If you don&#039;t mind insecurity and instability, concurrency can be quite easy. Listen-concurrency is really too specialized and complex a topic for llDialog, it really needs it&#039;s own page. It might be fun, I&#039;ll look into writing about how to do it. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 23:54, 13 November 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
:what strife said as far as concurrency being hairy. If you check out the helper function [[User:Void_Singer/Functions#uDlgBtnPagList]] that I added to the page a while back, you&#039;ll see that one way to avoid the concurrency issue is to ignore the conventional wisdom about closing listens, and fitering them in the listen, and instead use a single always on listen, and filter by user key as provided from within the listen event... it&#039;s not ideal in all ways (I don&#039;t recommend it for mass use of multiple objects in a single area) but it does make unlimited concurrency possible on a single listen. It also results in needing to do more script work per request to filter, but if you need concurrency, it is an option. knowing Strife, it&#039;ll be torn apart and something even better will be created from it = D &amp;lt;br/&amp;gt;-- &#039;&#039;&#039;[[User:Void_Singer|Void]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 14:21, 14 November 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
::That&#039;s a great solution for static content. I really like it. You could use something besides spaces to store more complex state info. I was thinking something more complex, tailored listens and release them as needed. The advantage of tailored listens is that you don&#039;t have to worry about parsing 3rd party messages but it comes at a slight performance cost of having to track listen handles. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 21:14, 14 November 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
== False ignore buttons ==&lt;br /&gt;
&lt;br /&gt;
The article says, &amp;quot;If a button is named &amp;lt;code&amp;gt;[&amp;quot;Ignore&amp;quot;]&amp;lt;/code&amp;gt;, it will behave like the small &amp;lt;code&amp;gt;[&amp;quot;Ignore&amp;quot;]&amp;lt;/code&amp;gt; button of the menu&amp;quot;.  I just tested that, and it didn&#039;t happen for me.  Is it viewer-dependent?  I&#039;m on Firestorm 4.6.5. --[[User:Brilliand Resident|Brilliand Resident]] 20:06, 18 August 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
: This was fixed in 2012, with [[Release Notes/Second Life Release/3.3.1|SL viewer 3.3.1]] and third party viewers based on it.  The issue was {{Jira|STORM-1718}}. Some viewers, especially those that keep a V1-style interface (Singularity, Cool VL), could still have the old behavior and should be tested. --[[User:ObviousAltIsObvious Resident|ObviousAltIsObvious Resident]] 20:35, 18 August 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
:: Documented. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 13:21, 20 August 2014 (PDT)&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User_talk:Strife_Onizuka/Float_Functions&amp;diff=1197518</id>
		<title>User talk:Strife Onizuka/Float Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User_talk:Strife_Onizuka/Float_Functions&amp;diff=1197518"/>
		<updated>2015-09-19T12:44:13Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: /* Try these */ Minor nitpick&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Ever considered making a fui16? ==&lt;br /&gt;
&lt;br /&gt;
I was just looking around for how I could union a float into a 16 bit integer, perhaps using the [http://en.wikipedia.org/wiki/Half-precision_floating-point_format IEEE 754-2008 half-precision] format.  Yes, I know there would be losses, and I also know that SL olny has 32 bit integers.  The final goal for my application is to pack two floats into a single integer, via bitshifting the first into the high range and then ORing with the second, a la:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// To pack:&lt;br /&gt;
float a = PI;&lt;br /&gt;
float b = 4.2;&lt;br /&gt;
integer result = (fui16(a) &amp;lt;&amp;lt; 0x10) | fui16(b);&lt;br /&gt;
&lt;br /&gt;
// To unpack:&lt;br /&gt;
float c = i16uf(result &amp;gt;&amp;gt; 0x10); // Might need to perform some further magic here to account for the fact that the sign bit doesn&#039;t shift.&lt;br /&gt;
float d = i16uf(result &amp;amp; 0xFFFF);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Of course, in the general case one can&#039;t make assumptions about range and resolution.  That said, in my application I &#039;&#039;can&#039;&#039; make such assumptions, and I&#039;m just going to hack together something that works based on those assumptions.  I&#039;m just here feeding the fetish that resulted in these very-useful-to-me functions (fui, iuf) in the first place. &amp;gt;:D&lt;br /&gt;
&lt;br /&gt;
{{Unsigned|Cron Stardust}}&lt;br /&gt;
&lt;br /&gt;
:Lets see, I could either work on [[Template:LSL Function]] et al as to split the notes section in half, or I could write fui16 a most clever function. Hmmm. Fun clever coding or Template drudge. Half precision doesn&#039;t have the same range, grrrr... -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 20:57, 24 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
:Upon second though, I really don&#039;t want to dig into floating point math at the moment. Mostly you just need to add clipping to fui, change the constants and add infinity support to iuf. With clipping implemented the error correcting code can be removed. Here is my first crack at updating the constants. I&#039;ve not tested it. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 21:35, 24 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
integer fui16(float a)//Mono Safe, LSO Safe, Doubles Unsupported, LSLEditor Unsafe&lt;br /&gt;
{//union half-precision float to short integer &lt;br /&gt;
    if((a)){//is it non zero?&lt;br /&gt;
        integer b = (integer)(a &amp;lt; 0) &amp;lt;&amp;lt; 15;//the sign, but later this variable is reused to store the shift&lt;br /&gt;
        if((a = llFabs(a)) &amp;lt; 0.0001220703125)//Denormalized range check &amp;amp; last stride of normalized range&lt;br /&gt;
            return b | (integer)(a * 16777216.0);//the math overlaps; saves cpu time.&lt;br /&gt;
        if(a &amp;gt; 65504.0)//Round up to infinity&lt;br /&gt;
            return b | 0x7C00;//Positive or negative infinity&lt;br /&gt;
        integer c = llFloor((llLog(a) / 0.69314718055994530941723212145818)) + 14;//extremes will error towards extremes. following yuch corrects it.&lt;br /&gt;
        return (0x3FF &amp;amp; (integer)(a * (0x800 &amp;gt;&amp;gt; b))) | (((c + (b = (integer)(a *= (0.0000152587890625 * (0x40000000 &amp;gt;&amp;gt; c))))) &amp;lt;&amp;lt; 10 ) | b);&lt;br /&gt;
    }//for grins, detect the sign on zero. it&#039;s not pretty but it works. the previous requires a lot of unwinding to understand it.&lt;br /&gt;
    return (integer)((string)a == (string)(-0.0)) &amp;lt;&amp;lt; 15;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
float i16uf(integer a)&lt;br /&gt;
{//union short integer to half-precision float&lt;br /&gt;
    if((a &amp;amp; 0x7C00) == 0x7C00)&lt;br /&gt;
        return (1 | ((a &amp;lt;&amp;lt; 16) &amp;gt;&amp;gt; 31)) * (float)&amp;quot;Infinity&amp;quot;;&lt;br /&gt;
    return 0.000000059604644775390625 * (1 &amp;lt;&amp;lt; (a - !!a)) * ((!!(a = (0x1f &amp;amp; (a &amp;gt;&amp;gt; 10))) &amp;lt;&amp;lt; 10) | ((a &amp;amp; 0x3ff))) * (1 | ((a &amp;lt;&amp;lt; 16) &amp;gt;&amp;gt; 31));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// To pack:&lt;br /&gt;
float a = PI;&lt;br /&gt;
float b = 4.2;&lt;br /&gt;
integer result = (fui16(a) &amp;lt;&amp;lt; 16) | fui16(b);&lt;br /&gt;
 &lt;br /&gt;
// To unpack:&lt;br /&gt;
float c = i16uf(result &amp;gt;&amp;gt; 16); // No magic needed, sign bit is handled correctly.&lt;br /&gt;
float d = i16uf(result);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
::Just tested in SL with the following results: Had to place a closing paren in the first return statement of iuf16, I placed it just before the mult as I suspect that&#039;s what was intended. I wrote a simple ownersay of the existing test code which gave the following as the output: [[User:Cron Stardust|Cron Stardust]] 16:12, 25 December 2012 (PST)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
  a = 3.141593 = 0xC90FDBp-22&lt;br /&gt;
= c = 3.140625 = 0xC9p-6&lt;br /&gt;
  b = 4.200000 = 0x433333p-20&lt;br /&gt;
= d = 4.199219 = 0x433p-8&amp;lt;/source&amp;gt;&lt;br /&gt;
::Further testing, looking for error cases, resulted in a lot of good: the functions seem to operate as they should.  I tested using all the constants demonstrated on the Wikipedia article and only one failed to match perfectly: 0.0000000596046 doesn&#039;t encode to 0x0001, instead it results in 0x0000. All other values seem to work great. [[User:Cron Stardust|Cron Stardust]] 22:00, 25 December 2012 (PST)&lt;br /&gt;
:: Also tested that with &amp;lt;code&amp;gt;a = -2.0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;b = -2.0&amp;lt;/code&amp;gt; that everything works out: no issues happen with the sign bit status that I could detect - so I took the liberty of changing the comment in your code. [[User:Cron Stardust|Cron Stardust]] 22:34, 25 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
:::I&#039;m willing to bet it&#039;s a lack of precision in their approximation. Try: 0.000000059604644775390625 -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 00:36, 26 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
:::I&#039;m not 100% sure of the &amp;quot;&amp;lt;code&amp;gt;llFloor((llLog(a) / 0.6931471...)&amp;lt;/code&amp;gt;&amp;quot; line but I think in this range it&#039;s accurate and we don&#039;t need to do any correction. The only way to know for sure is to try every value in the range [0.0001220703125, 65504.0]. I know it&#039;s not going to overflow so I&#039;ve removed the overflow protection code. If you want to do that testing, here is the return line you would use which assumes that &amp;quot;c&amp;quot; is accurate: &amp;lt;code&amp;gt;return (0x3FF &amp;amp; (integer)((a / (float)(&amp;quot;0x.004p&amp;quot;+(string)c)))) | (((c + 15) &amp;lt;&amp;lt; 10 ) | b);&amp;lt;/code&amp;gt; It has the added bonus of making fui16 LSLEditor safe. This was also a good demonstration of how the layers of correction code were bolted on. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 00:50, 26 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
This is a better version of what I was talking about but it needs extensive testing. If c is not accurate this will not work.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
		integer c = llFloor((llLog(a) / 0.69314718055994530941723212145818)) + 15;//extremes will error towards extremes. No corrections are attempted.&lt;br /&gt;
		return (0x3FF &amp;amp; (integer)((a * 0.03125 * (0x40000000 &amp;gt;&amp;gt; c)))) | ((c &amp;lt;&amp;lt; 10) | b);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
I&#039;ve gone back and removed my string-float pow code since it can all be done with integers and float math. Faster this way. Less stressful for the sim.&lt;br /&gt;
-- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 01:32, 26 December 2012 (PST)&lt;br /&gt;
=== Testing ===&lt;br /&gt;
Just run the following code and it will tell you if c is accurate for the entire half-precision range (this is one of the things iuf is really good for, iterating over every float value). -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 02:55, 26 December 2012 (PST)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
integer fui(float a)//Mono Safe, LSO Safe, Doubles Unsupported, LSLEditor Unsafe&lt;br /&gt;
{//union float to integer&lt;br /&gt;
    if((a))&lt;br /&gt;
    {//is it non zero?&lt;br /&gt;
        integer b = (a &amp;lt; 0) &amp;lt;&amp;lt; 31;//the sign, but later this variable is reused to store the shift&lt;br /&gt;
        if((a = llFabs(a)) &amp;lt; 2.3509887016445750159374730744445e-38)//Denormalized range check &amp;amp; last stride of normalized range&lt;br /&gt;
            return b | (integer)(a / 1.4012984643248170709237295832899e-45);//the math overlaps; saves cpu time.&lt;br /&gt;
        integer c = llFloor((llLog(a) / 0.69314718055994530941723212145818));//extremes will error towards extremes. following yuch corrects it.&lt;br /&gt;
        return (0x7FFFFF &amp;amp; (integer)(a * (0x1000000 &amp;gt;&amp;gt; b))) | (((c + 126 + (b = ((integer)a - (3 &amp;lt;= (a /= (float)(&amp;quot;0x1p&amp;quot;+(string)(c -= ((c &amp;gt;&amp;gt; 31) | 1)))))))) &amp;lt;&amp;lt; 23 ) | b);&lt;br /&gt;
    }//for grins, detect the sign on zero. it&#039;s not pretty but it works. the previous requires a lot of unwinding to understand it.&lt;br /&gt;
    return ((string)a == (string)(-0.0)) &amp;lt;&amp;lt; 31;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
float iuf(integer a)&lt;br /&gt;
{//union integer to float&lt;br /&gt;
    return ((float)(&amp;quot;0x1p&amp;quot;+(string)((a | !a) - 150))) * ((!!(a = (0xff &amp;amp; (a &amp;gt;&amp;gt; 23))) &amp;lt;&amp;lt; 23) | ((a &amp;amp; 0x7fffff))) * (1 | (a &amp;gt;&amp;gt; 31));&lt;br /&gt;
}//will crash if the raw exponent == 0xff; reason for crash deviates from float standard; though a crash is warranted.&lt;br /&gt;
&lt;br /&gt;
integer test(float a)//Mono Safe, LSO Safe, Doubles Unsupported, LSLEditor Unsafe&lt;br /&gt;
{//union half-precision float to short integer &lt;br /&gt;
    if((a))&lt;br /&gt;
    {//is it non zero?&lt;br /&gt;
        if((a = llFabs(a)) &amp;lt; 0.0001220703125)//Denormalized range check &amp;amp; last stride of normalized range&lt;br /&gt;
            return FALSE;//the math overlaps; saves cpu time.&lt;br /&gt;
        if(a &amp;gt; 65504.0)//Round up to infinity&lt;br /&gt;
            return FALSE;//Positive or negative infinity&lt;br /&gt;
        integer c = llFloor((llLog(a) / 0.69314718055994530941723212145818)) + 14;//extremes will error towards extremes. following yuch corrects it.&lt;br /&gt;
        return (integer)(a *= (0.0000152587890625 * (0x40000000 &amp;gt;&amp;gt; c))) - 1;&lt;br /&gt;
    }//for grins, detect the sign on zero. it&#039;s not pretty but it works. the previous requires a lot of unwinding to understand it.&lt;br /&gt;
    return FALSE;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
float i16uf(integer a)&lt;br /&gt;
{//union short integer to half-precision float&lt;br /&gt;
    if((a &amp;amp; 0x7C00) == 0x7C00)&lt;br /&gt;
        return (1 | ((a &amp;lt;&amp;lt; 16) &amp;gt;&amp;gt; 31)) * (float)&amp;quot;Infinity&amp;quot;;&lt;br /&gt;
    return 0.000000059604644775390625 * (1 &amp;lt;&amp;lt; (a - !!a)) * ((!!(a = (0x1f &amp;amp; (a &amp;gt;&amp;gt; 10))) &amp;lt;&amp;lt; 10) | ((a &amp;amp; 0x3ff))) * (1 | ((a &amp;lt;&amp;lt; 16) &amp;gt;&amp;gt; 31));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
list gBadBlockCounts;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;beginning test&amp;quot;);llResetTime();&lt;br /&gt;
        &lt;br /&gt;
        integer badCount = 0;&lt;br /&gt;
        integer badStart;&lt;br /&gt;
        &lt;br /&gt;
        integer start = fui(i16uf(1) / 2.0);//start just before min value, these will get clipped to zero.&lt;br /&gt;
        integer end = fui(65536.0);//stop just after infinity&lt;br /&gt;
        integer i;&lt;br /&gt;
        for(i = start;i &amp;lt; end; i++)&lt;br /&gt;
            if(test(iuf(i)))&lt;br /&gt;
            {&lt;br /&gt;
                llSetText(&amp;quot;bad:  &amp;quot;+(string)i, &amp;lt;1.0, 0.0, 0.0&amp;gt;, 1.0);&lt;br /&gt;
                if (badCount++ &amp;lt;= 0)&lt;br /&gt;
                {&lt;br /&gt;
                    badStart = i;&lt;br /&gt;
                    llOwnerSay(&amp;quot;Found bad number: &amp;quot; + (string) i);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llSetText(&amp;quot;good: &amp;quot;+(string)i, &amp;lt;0.0, 1.0, 0.0&amp;gt;, 1.0);&lt;br /&gt;
                if (badCount &amp;gt; 0)&lt;br /&gt;
                {&lt;br /&gt;
                    llOwnerSay(&amp;quot;Total of &amp;quot; + (string) badCount + &amp;quot; numbers, ending with &amp;quot; + (string) (i-1));&lt;br /&gt;
                    gBadBlockCounts = [badStart, i - 1] + gBadBlockCounts;&lt;br /&gt;
                    badCount = 0;&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        llSetText(&amp;quot;test complete.\ntook &amp;quot; + (string) llGetTime() + &amp;quot; secs over &amp;quot; + (string) (end - start) + &amp;quot; values\nsaw &amp;quot; + (string) llGetListLength(gBadBlockCounts) + &amp;quot; bad blocks.\nTouch for list of bad.&amp;quot;, &amp;lt;0.0, 1.0, 1.0&amp;gt;, 1.0);&lt;br /&gt;
        state printout;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state printout&lt;br /&gt;
{&lt;br /&gt;
    touch_end(integer index)&lt;br /&gt;
    {&lt;br /&gt;
        while (--index &amp;gt;= 0)&lt;br /&gt;
        {&lt;br /&gt;
            if (llGetListLength(gBadBlockCounts))&lt;br /&gt;
            {&lt;br /&gt;
                llRegionSayTo(llDetectedKey(index), 0,&lt;br /&gt;
                    &amp;quot;Bad blocks strided list, using stride pattern (block_start, block_end):&amp;quot;&lt;br /&gt;
                );&lt;br /&gt;
                llRegionSayTo(llDetectedKey(index), 0,&lt;br /&gt;
                    llDumpList2String(gBadBlockCounts, &amp;quot;, &amp;quot;)&lt;br /&gt;
                );&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llRegionSayTo(llDetectedKey(index), 0,&lt;br /&gt;
                    &amp;quot;Nothing to report.&amp;quot;&lt;br /&gt;
                );&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
::Tested this morning.  Went bad at values 864026624 through 900508790.  Not sure if there were further values: I set it up to run and then wen to work for the day, when I came back it had been yelling for a very long time... :P  Will see what I can do, however while I can understand the code, I&#039;ve not yet been able to get my mind in deep enough to understand the algorithm. [[User:Cron Stardust|Cron Stardust]] 18:55, 26 December 2012 (PST)  EDIT: Just noticed that there was a function named test in there that wasn&#039;t used: I&#039;d pasted in the fui16 function from above to make the code compile and run.  That may have invalidated the test, so I&#039;ve going to retest usung the &amp;quot;test&amp;quot; function in place of the fui16 call in state_entry.  I&#039;ve edited the above state_entry to reflect my current code.&lt;br /&gt;
::Just passed the 864026624 mark without errors, so yes: my previous test was invalid.  Continuing testing - just like GLaDOS likes. [[User:Cron Stardust|Cron Stardust]] 20:59, 26 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
:::I should have thought of this sooner, we don&#039;t need to test every value, just the ones who&#039;s values surround where the value of &amp;quot;c&amp;quot; changes. We only need to test ummm 84 values... just the powers of two and the immediate lesser values. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 01:44, 27 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
integer fui(float a)//Mono Safe, LSO Safe, Doubles Unsupported, LSLEditor Unsafe&lt;br /&gt;
{//union float to integer&lt;br /&gt;
    if((a))&lt;br /&gt;
    {//is it non zero?&lt;br /&gt;
        integer b = (integer)(a &amp;lt; 0) &amp;lt;&amp;lt; 31;//the sign, but later this variable is reused to store the shift&lt;br /&gt;
        if((a = llFabs(a)) &amp;lt; 2.3509887016445750159374730744445e-38)//Denormalized range check &amp;amp; last stride of normalized range&lt;br /&gt;
            return b | (integer)(a / 1.4012984643248170709237295832899e-45);//the math overlaps; saves cpu time.&lt;br /&gt;
        integer c = llFloor((llLog(a) / 0.69314718055994530941723212145818));//extremes will error towards extremes. following yuch corrects it.&lt;br /&gt;
        a /= (float)(&amp;quot;0x1p&amp;quot;+(string)(c -= ((c &amp;gt;&amp;gt; 31) | 1)));&lt;br /&gt;
        integer bb = ((integer)a - (3 &amp;lt;= a));&lt;br /&gt;
        return (0x7FFFFF &amp;amp; (integer)(a * (0x1000000 &amp;gt;&amp;gt; bb))) | (((c + 126 + bb) &amp;lt;&amp;lt; 23 ) | b);&lt;br /&gt;
    }//for grins, detect the sign on zero. it&#039;s not pretty but it works. the previous requires a lot of unwinding to understand it.&lt;br /&gt;
    return (integer)((string)a == (string)(-0.0)) &amp;lt;&amp;lt; 31;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
float iuf(integer a)&lt;br /&gt;
{//union integer to float&lt;br /&gt;
    integer aa = 0xff &amp;amp; (a &amp;gt;&amp;gt; 23);&lt;br /&gt;
    return ((float)(&amp;quot;0x1p&amp;quot;+(string)((aa | !aa) - 150))) * ((!!aa &amp;lt;&amp;lt; 23) | ((a &amp;amp; 0x7fffff))) * (1 | (a &amp;gt;&amp;gt; 31));&lt;br /&gt;
}//will crash if the raw exponent == 0xff; reason for crash deviates from float standard; though a crash is warranted.&lt;br /&gt;
&lt;br /&gt;
integer get_log2(float a)&lt;br /&gt;
{//we use the natural log because testing showed it&#039;s more accurate than log10.&lt;br /&gt;
    return llFloor((llLog(a) / 0.69314718055994530941723212145818));//must be divide, multiplying the reciprocal adds extra corruption.&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer test_log2(integer power)&lt;br /&gt;
{&lt;br /&gt;
    float a = (float)(&amp;quot;0x1p&amp;quot;+(string)power);&lt;br /&gt;
    float b = iuf(fui(a) - 1);//The underflow is in our favor and does what we want.&lt;br /&gt;
    integer c = get_log2(a);&lt;br /&gt;
    integer d = get_log2(b);&lt;br /&gt;
    integer e = (c == power) &amp;amp;&amp;amp; ((d + 1) == power);&lt;br /&gt;
//    llOwnerSay(llList2CSV([power, c, d, Float2Hex(a), Float2Hex(b), int2hexdword(fui(a)), int2hexdword(fui(b)), e]));&lt;br /&gt;
    return e;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        integer start = -25;&lt;br /&gt;
        integer end = 17;&lt;br /&gt;
        integer i;&lt;br /&gt;
        for(i = start; i &amp;lt;= end; i++)&lt;br /&gt;
            if(!test_log2(i))&lt;br /&gt;
                llOwnerSay((string)i);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
:: Ok, so executed - though I&#039;m leaving the other script running, and it seems good thus far; will report when it completes.  The results from this new test are that I saw values reported in the following ranges: [-25, -16], -14, [-12, -2], [3, 17] -- [[User:Cron Stardust|Cron Stardust]] 19:14, 27 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
::: Well that is bad. Guess c is not accurate so we can&#039;t remove the correction code (the overflow code can still be removed). I wonder what happens if you feed it NaN. Probably need a special case just for that. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 20:45, 27 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
::: I remembered how the correction code works and I fused one of the moving parts. I don&#039;t think it&#039;s necessary for this range but I&#039;m adding it back in. Since &amp;quot;c&amp;quot; could be off by one in either direction, this gives us three possible outcomes when generating new-a.&lt;br /&gt;
:::# It&#039;s too small, the result is that new-a is in range [0.5, 1)&lt;br /&gt;
:::# C is correct, new-a is in range [1, 2)&lt;br /&gt;
:::# It&#039;s too big, the result is that new-a is in range [2,4)&lt;br /&gt;
:::Solution? Map these three outcomes to three consecutive values so that they can be used to adjust c. Truncating new-a gives us [0.5, 1)-&amp;gt;0, [1, 2)-&amp;gt;1, [2,4)-&amp;gt;{2,3}. Yes they are consecutive but we need to map the final set to a single value. Hence the subtract by (3 &amp;lt;= a).&lt;br /&gt;
:::It&#039;s a shame I never documented which edge cases this code fixed. It would take a lot of the guess work out. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 21:22, 27 December 2012 (PST)&lt;br /&gt;
: For what it&#039;s worth, the old test code finally completed!  Took about 6-8 days continuous* calculation in my home region. (* script reported 521479.8 seconds, but I&#039;d had to stop and fix a UI error after several hours of computation, and picked up where I&#039;d left off.)  Here&#039;s the report: [[User:Cron Stardust|Cron Stardust]] 18:14, 5 January 2013 (PST)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bad blocks list, using stride pattern [block_start, block_end]:&lt;br /&gt;
[&lt;br /&gt;
 [1191182336, 1191182336], [1182793721, 1182793727], [1174405120, 1174405120], [1166016505, 1166016511], &lt;br /&gt;
 [1157627901, 1157627903], [1149239293, 1149239295], [1140850685, 1140850687], [1132462077, 1132462079], &lt;br /&gt;
 [1124073469, 1124073471], [1115684861, 1115684863], [1107296255, 1107296255], [1098907647, 1098907647], &lt;br /&gt;
 [1090519039, 1090519039], [1048575999, 1048575999], [1040187390, 1040187391], [1031798782, 1031798783], &lt;br /&gt;
 [1023410174, 1023410175], [1015021564, 1015021567], [1006632956, 1006632959], [ 998244348,  998244351], &lt;br /&gt;
 [ 989855740,  989855743], [ 981467132,  981467135], [ 973078524,  973078527], [ 964689912,  964689919]&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== fui support for NaN and Inf ==&lt;br /&gt;
&lt;br /&gt;
I must be one of the few people who have found an actual use to fui :) I&#039;m using it for compact lossless transmission of floats over HTTP to a PHP server in base 64 (after removing the == and the trailing A&#039;s), and I decode it in the server using unpack() and some string manipulation. I would love to see fui support NaN, Inf and -Inf, but more for the sake of completion than because I have a real use (except possibly debugging). Maybe it&#039;s as straightforward as adding this on top?&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
  if ((string)a == &amp;quot;Infinity&amp;quot;) return 0x7F800000;&lt;br /&gt;
  if ((string)a == &amp;quot;-Infinity&amp;quot;) return 0xFF800000;&lt;br /&gt;
  if ((string)a == &amp;quot;NaN&amp;quot;) return 0x7FC00000; // to choose one&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
I guess there&#039;s no way to extract the actual bits of a NaN, or is there? --[[User:Pedro Oval|Pedro Oval]] 05:09, 26 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
Oops, I&#039;ve corrected &amp;quot;Inf&amp;quot; to read &amp;quot;Infinity&amp;quot; above. --[[User:Pedro Oval|Pedro Oval]] 07:58, 26 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
:Sure, I don&#039;t see why not. I&#039;ll think about ways of doing it (I&#039;m not sure if successive tests is really the best way of doing so). The reason Infinity was never handled was that LSO doesn&#039;t allow it. These functions were originally conceived before Mono was on the horizon (at the time I had wanted to build an LSO bytecode emulator in LSL). -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 01:01, 27 December 2012 (PST)&lt;br /&gt;
:It&#039;s done. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 22:43, 27 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
::You will be pleased (or horrified) to see that [[Float2Hex]] and [[Float2Sci]] both support NaN and Infinities now. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 00:22, 29 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
== Alternate code ==&lt;br /&gt;
&lt;br /&gt;
I was pondering alternate ways to &amp;lt;code&amp;gt;b &amp;gt;&amp;gt; (13 + ((b &amp;amp; 0x3FFF) == 0x2000))&amp;lt;/code&amp;gt; because it&#039;s just so ugly.&lt;br /&gt;
*&amp;lt;code&amp;gt;b &amp;gt;&amp;gt; (((0x3FFF &amp;amp; b ^ 0x1FFF) + 0x34001) &amp;gt;&amp;gt; 14)&amp;lt;/code&amp;gt; - we flip the low bits, so if all of them are on, that is to say our condition has been met, adding one will cause a carry into the 14th bit.&lt;br /&gt;
*&amp;lt;code&amp;gt;b &amp;gt;&amp;gt; ((0x38000 - (0x3FFF &amp;amp; b ^ 0x2000)) &amp;gt;&amp;gt; 14)&amp;lt;/code&amp;gt; - similar to above, we turn the high bit off, so if it&#039;s zero it doesn&#039;t cause a carry from above.&lt;br /&gt;
*&amp;lt;code&amp;gt;b / ((((0x3FFF &amp;amp; b ^ 0x1FFF) + 0x4001) &amp;amp; 0xC000) &amp;gt;&amp;gt; 1)&amp;lt;/code&amp;gt;&lt;br /&gt;
It&#039;s a shame there isn&#039;t a way to further improve it. It&#039;s an ugly mess that only gets uglier. ~_~ -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 23:22, 28 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
= Bugs in iuf and fui =&lt;br /&gt;
== Bug in iuf ==&lt;br /&gt;
&lt;br /&gt;
iuf does not support exponent parts of 2&amp;lt;sup&amp;gt;-104&amp;lt;/sup&amp;gt; or below. The reason is that in an intermediate step, it is trying to calculate 0x1p-127 or below, which yields 0. For exaple, iuf(0x0bffffff) returns 0, while iuf(0x0c00000) returns the correct result.&lt;br /&gt;
&lt;br /&gt;
Rather than trying to find a fix, I created my own iuf that seems to work, even if it&#039;s unoptimized and not very fast (though it contains a small trick to reduce the total number of iterations to a maximum of 25 or so):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
float iuf(integer e)&lt;br /&gt;
{&lt;br /&gt;
    float result = e &amp;amp; 0x7FFFFF;&lt;br /&gt;
    integer sign = e &amp;amp; 0x80000000;&lt;br /&gt;
    e = ((e &amp;gt;&amp;gt; 23) &amp;amp; 0xFF) + -150;&lt;br /&gt;
    // deal with Inf/NaN&lt;br /&gt;
    if (e == 105) { if (result) return (float)&amp;quot;NaN&amp;quot;; if (sign) return (float)&amp;quot;-Inf&amp;quot;; return (float)&amp;quot;Inf&amp;quot;; }&lt;br /&gt;
    if (e ^ -150)&lt;br /&gt;
    {&lt;br /&gt;
        result += 0x800000;&lt;br /&gt;
        while (e &amp;gt; 9) { result *= 512; e += -9; }&lt;br /&gt;
        while (e &amp;lt; -9) { result *= 0.001953125; e += 9; }&lt;br /&gt;
        while (e &amp;gt; 0) { result *= 2; --e; }&lt;br /&gt;
        while (e &amp;lt; 0) { result *= 0.5; ++e; }&lt;br /&gt;
        if (sign) return -result;&lt;br /&gt;
        return result;&lt;br /&gt;
    }&lt;br /&gt;
    if (sign) return -(result*1e-45);&lt;br /&gt;
    return result*1e-45;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A fix might be along the lines of not applying the -23 offset in advance (as usage of -150 implies) but postmultiplying by 2^-23 instead. I haven&#039;t tried though. --[[User:Pedro Oval|Pedro Oval]] 09:37, 8 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:If the denormalized range isn&#039;t working then Float2Hex is likely broken too. hmmm -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 11:11, 9 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
::It&#039;s not just the denormal range, it affects the normal range too. 2&amp;lt;sup&amp;gt;-104&amp;lt;/sup&amp;gt; is small but not denormal; the denormal range starts at 2&amp;lt;sup&amp;gt;-127&amp;lt;/sup&amp;gt;. --[[User:Pedro Oval|Pedro Oval]] 16:22, 9 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
:::I start the denormalized range a power of two early but if it&#039;s failing all the way up to -104... that&#039;s a big problem. I&#039;ll have to play with it. Multiplying by a power of two shouldn&#039;t trash the mantissa. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 20:29, 11 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
::::Maybe I misunderstood. If what you meant is that hex floating point format is unable to produce denormal numbers, then that&#039;s exactly the problem, yes. 0x1p-127 produces 0, even if the denormal range can represent numbers down to 0x1p-149. What I meant is that inputs to the function representing exponents of -104 or below failed (as these involved calculation of 0x1p-127 or below). Now some good news. The new function revised to use [[llPow]] works correctly for small exponents and seems to work correctly for the rest. Also, under Mono at least its performance is about 2.5 times that of the old (string operations are s-l-o-w). --[[User:Pedro Oval|Pedro Oval]] 06:24, 12 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
== Bug in fui ==&lt;br /&gt;
&lt;br /&gt;
Alas, iuf is not the only one with problems. For exponents of -2 or less, and mantissas in the vicinity of 0x7FFFFF, results are almost always wrong. Examples:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;fui(iuf(0x017fffdd)) = 0x01ffffee&amp;lt;/code&amp;gt; (the first one failing with mantissa &amp;gt; 0x7FFF00, exponent is -124)&lt;br /&gt;
* &amp;lt;code&amp;gt;fui(iuf(0x017fffff)) = 0x01ffffff&amp;lt;/code&amp;gt; (the last one failing with that exponent; all in the middle also fail)&lt;br /&gt;
* &amp;lt;code&amp;gt;fui(iuf(0x01ffffc5)) = 0x027fffe2&amp;lt;/code&amp;gt; (next one failing)&lt;br /&gt;
* &amp;lt;code&amp;gt;fui(iuf(0x01ffffff)) = 0x027fffff&amp;lt;/code&amp;gt; (last one with that exponent, all in the middle fail)&lt;br /&gt;
* &amp;lt;code&amp;gt;fui(iuf(0x037ffffd)) = 0x03fffffe&amp;lt;/code&amp;gt; (for this exponent the failure range is shorter - just 3 numbers)&lt;br /&gt;
* &amp;lt;code&amp;gt;fui(iuf(0x38ffffff)) = 0x38ffffff&amp;lt;/code&amp;gt; (for a few exponents there are no failures at all; this is an example)&lt;br /&gt;
* &amp;lt;code&amp;gt;fui(iuf(0x3e7fffff)) = 0x3effffff&amp;lt;/code&amp;gt; (last one failing)&lt;br /&gt;
&lt;br /&gt;
I&#039;ve manually checked some of the iuf conversions and they worked correctly with the code I posted above, so the problem is in fui. For example: &amp;lt;code&amp;gt;if (iuf(0x25fffff6) == .44408894e-15) llOwnerSay(&amp;quot;iuf ok&amp;quot;);&amp;lt;/code&amp;gt; says &amp;quot;iuf ok&amp;quot;, but fui(.44408894e-15) gives 0x267ffffb, not 0x25fffff6. --[[User:Pedro Oval|Pedro Oval]] 11:48, 8 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
:Are you doing these tests in Mono, LSO or both? -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 10:48, 9 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
::I tested the full range only in Mono, but a quick run seems to show that LSO is affected in exactly the same way. At least the range starts in the same number (0x017fffdd) and produces the same result (0x01ffffee). --[[User:Pedro Oval|Pedro Oval]] 16:31, 9 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
:It will take me some time (maybe a few weeks) to get around to this, I&#039;m very busy currently. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 11:14, 9 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
::I admit to kicking off Pedro&#039;s investigation, as I tried to use iuf and fui in Mono and found that fui (iuf (x) )  gave zero for all values of x from 1 to 3 million, at which point when I gave up :) They seem to work a lot better in LSO from my briefer tests so far. [[User:Omei Qunhua|Omei Qunhua]] 15:52, 9 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
= Try these =&lt;br /&gt;
I&#039;ve swapped out the hack pow method for the real function. I&#039;m hoping this will fix iuf.&lt;br /&gt;
&lt;br /&gt;
I&#039;ve also expanded the compressed lines so that they are easier to tinker with. I&#039;ve enlarged the supported range of &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; in the error calculation, the range supported has changed from [0.5, 4) to [0.25, 4).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
integer fui(float a)//Mono Safe, LSO Safe, Doubles Unsupported, LSLEditor Unsafe&lt;br /&gt;
{//union float to integer&lt;br /&gt;
    if((a)){//is it greater than or less than zero?&lt;br /&gt;
        integer b = (a &amp;lt; 0) &amp;lt;&amp;lt; 31;//the sign, but later this variable is reused to store the shift&lt;br /&gt;
        if((a = llFabs(a)) &amp;lt; 2.3509887016445750159374730744445e-38)//Denormalized range check &amp;amp; last stride of normalized range&lt;br /&gt;
            return b | (integer)(a / 1.4012984643248170709237295832899e-45);//the math overlaps; saves cpu time.&lt;br /&gt;
        if(a &amp;gt; 3.4028234663852885981170418348452e+38)//Round up to infinity&lt;br /&gt;
            return b | 0x7F800000;//Positive or negative infinity&lt;br /&gt;
        integer c = llFloor((llLog(a) / 0.69314718055994530941723212145818));//extremes will error towards extremes. following yuch corrects it.&lt;br /&gt;
        c -= (c &amp;gt;&amp;gt; 31) | 1;//this sets up an error towards the zero&lt;br /&gt;
        a /= llPow(2.0, c);//a should now be in the range [0.25, 4).&lt;br /&gt;
        integer d = (integer)a + (0.5 &amp;gt;= a) - (3 &amp;lt;= a);//This calculates the actual error. It does so by mapping the value of a to the error.&lt;br /&gt;
        //Specifically we take advantage of the where the normalization bit has been shifted.&lt;br /&gt;
        //[0.25, 0.5) == -2, [0.5, 1) == -1, [1,2) == 0, [2, 4) == 1 ~ note the actual values of d are off by two.&lt;br /&gt;
        llOwnerSay(llList2CSV([0x800000 == (0xF800000 &amp;amp; (integer)(a * (0x2000000 &amp;gt;&amp;gt; d))), c, d, a, (a &amp;lt; 0.25) || (a &amp;gt; 4)]));//first value tells you if you got d right or wrong.&lt;br /&gt;
        //The check works by seeing where the normalization bit has been shifted. The normalization bit gets chopped off with 0x7FFFFF.&lt;br /&gt;
        return (0x7FFFFF &amp;amp; (integer)(a * (0x2000000 &amp;gt;&amp;gt; d))) | (((c + 125 + d) &amp;lt;&amp;lt; 23 ) | b);&lt;br /&gt;
    }//the previous requires a lot of unwinding to understand it.&lt;br /&gt;
    if(a == 0)//Just because it&#039;s not greater than or less than zero doesn&#039;t mean it&#039;s non-zero.&lt;br /&gt;
        return ((string)a == (string)(-0.0)) &amp;lt;&amp;lt; 31;//for grins, detect the sign on zero. it&#039;s not pretty but it works.&lt;br /&gt;
    //Mono does not support indeterminates so I&#039;m not going to worry about it.&lt;br /&gt;
    return 0x7FFFFFFF;//NaN time! We have no way to tell NaN&#039;s apart so lets just choose one.&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
float iuf(integer a)&lt;br /&gt;
{//union integer to float&lt;br /&gt;
    if((a &amp;amp; 0x7F800000) == 0x7F800000)&lt;br /&gt;
        return (1 | (a &amp;gt;&amp;gt; 31)) * (float)llList2String([&amp;quot;NaN&amp;quot;,&amp;quot;Infinity&amp;quot;], !(a &amp;amp; 0x7FFFFF));&lt;br /&gt;
    integer b = 0xff &amp;amp; (a &amp;gt;&amp;gt; 23);&lt;br /&gt;
    return llPow(2.0, (b | !b) - 150) * (((!!b) &amp;lt;&amp;lt; 23) | ((a &amp;amp; 0x7fffff))) * (1 | (a &amp;gt;&amp;gt; 31));&lt;br /&gt;
}//will crash if the raw exponent == 0xff; reason for crash deviates from float standard; though a crash is warranted.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
::The above fails at every number from the range I tested (mantissa in the vicinity of 0x3FFFFF, exponent -2 and below). --[[User:Pedro Oval|Pedro Oval]] 06:24, 12 February 2013 (PST)&lt;br /&gt;
:::More specifically, it seems to fail for all numbers with bit 22 set (mask 0x00400000). --[[User:Pedro Oval|Pedro Oval]] 16:53, 13 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
This uses a modified error correction code. I&#039;m not sure if it will be better or worse. It has the potential to run out the high side of the stated bounds on &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; but I don&#039;t think this will be the case. We shall have to see.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
integer fui(float a)//Mono Safe, LSO Safe, Doubles Unsupported, LSLEditor Unsafe&lt;br /&gt;
{//union float to integer&lt;br /&gt;
    if((a)){//is it greater than or less than zero?&lt;br /&gt;
        integer b = (a &amp;lt; 0) &amp;lt;&amp;lt; 31;//the sign, but later this variable is reused to store the shift&lt;br /&gt;
        if((a = llFabs(a)) &amp;lt; 2.3509887016445750159374730744445e-38)//Denormalized range check &amp;amp; last stride of normalized range&lt;br /&gt;
            return b | (integer)(a / 1.4012984643248170709237295832899e-45);//the math overlaps; saves cpu time.&lt;br /&gt;
        if(a &amp;gt; 3.4028234663852885981170418348452e+38)//Round up to infinity&lt;br /&gt;
            return b | 0x7F800000;//Positive or negative infinity&lt;br /&gt;
        integer c = llFloor((llLog(a) / 0.69314718055994530941723212145818));//extremes will error towards extremes. following yuch corrects it.&lt;br /&gt;
        --c;//Make it error down. Hopefully this won&#039;t shift anyone into the [4, 8) range.&lt;br /&gt;
        a /= llPow(2.0, c);//a should now be in the range [0.5, 4), we assume no error is added.&lt;br /&gt;
        integer d = (integer)a - (3 &amp;lt;= a);//This calculates the actual error. As it turns out, the integer portion of a is {0,1,2,3} the errors in c are {-1,0,1,1}&lt;br /&gt;
        llOwnerSay(llList2CSV([0x800000 == (0xF800000 &amp;amp; (integer)(a * (0x2000000 &amp;gt;&amp;gt; d))), c, d, a]));&lt;br /&gt;
        return (0x7FFFFF &amp;amp; (integer)(a * (0x1000000 &amp;gt;&amp;gt; d))) | (((c + 126 + d) &amp;lt;&amp;lt; 23 ) | b);&lt;br /&gt;
    }//the previous requires a lot of unwinding to understand it.&lt;br /&gt;
    if(a == 0)//Just because it&#039;s not greater than or less than zero doesn&#039;t mean it&#039;s non-zero.&lt;br /&gt;
        return ((string)a == (string)(-0.0)) &amp;lt;&amp;lt; 31;//for grins, detect the sign on zero. it&#039;s not pretty but it works.&lt;br /&gt;
    //Mono does not support indeterminates so I&#039;m not going to worry about it.&lt;br /&gt;
    return 0x7FFFFFFF;//NaN time! We have no way to tell NaN&#039;s apart so lets just choose one.&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
float iuf(integer a)&lt;br /&gt;
{//union integer to float&lt;br /&gt;
    if((a &amp;amp; 0x7F800000) == 0x7F800000)&lt;br /&gt;
        return (1 | (a &amp;gt;&amp;gt; 31)) * (float)llList2String([&amp;quot;NaN&amp;quot;,&amp;quot;Infinity&amp;quot;], !(a &amp;amp; 0x7FFFFF));&lt;br /&gt;
    integer b = 0xff &amp;amp; (a &amp;gt;&amp;gt; 23);&lt;br /&gt;
    return llPow(2.0, (b | !b) - 150) * (((!!b) &amp;lt;&amp;lt; 23) | ((a &amp;amp; 0x7fffff))) * (1 | (a &amp;gt;&amp;gt; 31));&lt;br /&gt;
}//will crash if the raw exponent == 0xff; reason for crash deviates from float standard; though a crash is warranted.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
::The above passed the test in the range where version 1 failed (vicinity of 0x7fffff for mantissa and exponents up to -2). Also, fui(iuf(i))==i produces no mismatch in a random sample of 2M integers (version 1 produced 2 mismatches in a random sample of 1M). Looks promising. I&#039;m not testing it in LSO though - too slow :) --[[User:Pedro Oval|Pedro Oval]] 06:24, 12 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
:::A distributed computation over the whole range of integers except those representing NaN and Inf (I used 64 scripts in 16 sims computing 64M numbers each) has showed that the fui and iuf functions above work flawlessly for every supported integer. Those representing NaN were not tested for the obvious reason of unavoidable data loss. We have a winner. Thank you so very very much. --[[User:Pedro Oval|Pedro Oval]] 21:34, 13 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
::::This is kind of scary, I wasn&#039;t expecting this version to work. The other version was the one I was expecting to work. Sounds like there were two bugs. I&#039;ll compress it back into an optimized form. This makes me worry about Float2Hex working, since it sounds like the string-&amp;gt;float typecast doesn&#039;t like very small numbers. I wonder if there is a cap on the exponent? I shall have to test. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 11:08, 14 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
::::: I&#039;ve made some experiments now. &amp;lt;code&amp;gt;(float)&amp;quot;something&amp;quot;&amp;lt;/code&amp;gt; seems to fail under Mono whenever &amp;quot;something&amp;quot; results in a number with an absolute value less than &amp;lt;code&amp;gt;0x1p-126&amp;lt;/code&amp;gt;, no matter if it&#039;s hex or otherwise.&lt;br /&gt;
&lt;br /&gt;
::::: However, &amp;lt;code&amp;gt;(vector)&amp;quot;&amp;amp;lt;something,something,something&amp;gt;&amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;(rotation)&amp;quot;&amp;amp;lt;something,something,something,something&amp;gt;&amp;quot;&amp;lt;/code&amp;gt; both work fine with numbers in that range even in Mono.&lt;br /&gt;
&lt;br /&gt;
::::: Go figure... -- [[User:Pedro Oval|Pedro Oval]] ([[User talk:Pedro Oval|talk]]) 05:41, 19 September 2015 (PDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
integer fui(float a)//Mono Safe, LSO Safe, Doubles Unsupported, LSLEditor Unsafe&lt;br /&gt;
{//union float to integer&lt;br /&gt;
    if((a)){//is it greater than or less than zero?&lt;br /&gt;
        integer b = (a &amp;lt; 0) &amp;lt;&amp;lt; 31;//the sign, but later this variable is reused to store the shift&lt;br /&gt;
        if((a = llFabs(a)) &amp;lt; 2.3509887016445750159374730744445e-38)//Denormalized range check &amp;amp; last stride of normalized range&lt;br /&gt;
            return b | (integer)(a / 1.4012984643248170709237295832899e-45);//the math overlaps; saves cpu time.&lt;br /&gt;
        if(a &amp;gt; 3.4028234663852885981170418348452e+38)//Round up to infinity&lt;br /&gt;
            return b | 0x7F800000;//Positive or negative infinity&lt;br /&gt;
        integer c = ~-llFloor((llLog(a) / 0.69314718055994530941723212145818));//extremes will error towards extremes. following yuch corrects it.&lt;br /&gt;
        return (0x7FFFFF &amp;amp; (integer)(a * (0x1000000 &amp;gt;&amp;gt; b))) | (((c + 126 + (b = ((integer)a - (3 &amp;lt;= (a /= llPow(2.0, c)))))) &amp;lt;&amp;lt; 23 ) | b);&lt;br /&gt;
    }//the previous requires a lot of unwinding to understand it.&lt;br /&gt;
    if(a == 0)//Just because it&#039;s not greater than or less than zero doesn&#039;t mean it&#039;s non-zero.&lt;br /&gt;
        return ((string)a == (string)(-0.0)) &amp;lt;&amp;lt; 31;//for grins, detect the sign on zero. it&#039;s not pretty but it works.&lt;br /&gt;
    //Mono does not support indeterminates so I&#039;m not going to worry about it.&lt;br /&gt;
    return 0x7FFFFFFF;//NaN time! We have no way to tell NaN&#039;s apart so lets just choose one.&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
float iuf(integer a)&lt;br /&gt;
{//union integer to float&lt;br /&gt;
    if((a &amp;amp; 0x7F800000) == 0x7F800000)&lt;br /&gt;
        return (1 | (a &amp;gt;&amp;gt; 31)) * (float)llList2String([&amp;quot;NaN&amp;quot;,&amp;quot;Infinity&amp;quot;], !(a &amp;amp; 0x7FFFFF));&lt;br /&gt;
    return llPow(2.0, (a | !a) - 150) * (((!!(a = (0xff &amp;amp; (a &amp;gt;&amp;gt; 23)))) &amp;lt;&amp;lt; 23) | ((a &amp;amp; 0x7fffff))) * (1 | (a &amp;gt;&amp;gt; 31));&lt;br /&gt;
}//will crash if the raw exponent == 0xff; reason for crash deviates from float standard; though a crash is warranted.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Lots to comment on, and MediaWiki&#039;s standard for follow-up responses is quite inconvenient for this purpose. I hope you don&#039;t mind if I post this reply without indentation.&lt;br /&gt;
&lt;br /&gt;
First, I&#039;m pretty sure that the failure of the previous function must be due to a bug somewhere, not to the algorithm, given that the failure pattern seems very clear and consistent. I haven&#039;t analyzed it so I can&#039;t tell more for now.&lt;br /&gt;
&lt;br /&gt;
Second, your sentence &amp;quot;I wonder if there is a cap on the exponent?&amp;quot; suggests to me that you have missed my last reply in the [[#Bug in iuf|iuf bug discussion]].&lt;br /&gt;
&lt;br /&gt;
Third, the &amp;quot;compressed&amp;quot; versions work, though I haven&#039;t tested the whole range, just a random sample of 10M integers.&lt;br /&gt;
&lt;br /&gt;
Fourth, the NaN test is flawed. if((a)) is equivalent to if(!(a==0)) and is true for NaNs.&lt;br /&gt;
&lt;br /&gt;
Fifth, the usual NaN returned by gcc is 0x7FC00000, so I suggest to use that for possible interoperability. It has the &amp;quot;quiet&amp;quot; bit set and nothing else.&lt;br /&gt;
&lt;br /&gt;
Sixth, I see quite some room for memory optimizations in Mono for both functions, while minimally affecting performance if at all. Changes include:&lt;br /&gt;
&lt;br /&gt;
* Changing division to multiplication where possible.&lt;br /&gt;
* Changing &amp;lt;= to &amp;lt; and &amp;gt;= to &amp;gt; where possible. a &amp;lt;= b is equivalent to !(a &amp;gt; b) both in size and in behavior even with NaNs (sad, I know).&lt;br /&gt;
* Changing subtraction to addition of opposite (a-b to a+-b).&lt;br /&gt;
* Changing -constant to its hex representation.&lt;br /&gt;
* Changing 2.0 to 2&lt;br /&gt;
* Changing &amp;lt;&amp;lt; constant to * constant (&amp;gt;&amp;gt; and / take the same bytes so no gain there, plus there are sign issues).&lt;br /&gt;
* Changing (a &amp;amp; constant) == constant to !(~a &amp;amp; constant).&lt;br /&gt;
* Using localint^localint instead of 0.&lt;br /&gt;
* Change the logic of Infinity and NaN in iuf, to get rid of the list, using that (float)&amp;quot;Inf&amp;quot; yields infinity and that parsing stops at the first invalid character without invalidating the previous results.&lt;br /&gt;
* Changing (string)-0.0 to &amp;quot;-0.000000&amp;quot; (this one is the only one I don&#039;t have reliable experimental results to back, but I believe it will save memory; it almost surely will perform better by not needing to build that string at run time).&lt;br /&gt;
&lt;br /&gt;
Here are Mono-memory-optimized versions taking into account all of these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
integer fui(float a)//Mono Safe, ????LSO Safe???? (untested), Doubles Unsupported, LSLEditor Unsafe&lt;br /&gt;
{//union float to integer&lt;br /&gt;
    if(a){//is it nonzero?&lt;br /&gt;
        integer b = (a &amp;lt; 0) * 0x80000000;//the sign, but later this variable is reused to store the shift&lt;br /&gt;
        if((a = llFabs(a)) &amp;lt; 2.3509887016445750159374730744445e-38)//Denormalized range check &amp;amp; last stride of normalized range&lt;br /&gt;
            return b | (integer)(a / 1.4012984643248170709237295832899e-45);//the math overlaps; saves cpu time.&lt;br /&gt;
        if(a &amp;gt; 3.4028234663852885981170418348452e+38)//Round up to infinity&lt;br /&gt;
            return b | 0x7F800000;//Positive or negative infinity&lt;br /&gt;
        if(a &amp;gt; 1e-45)//It should at this point, except if it&#039;s NaN&lt;br /&gt;
        {&lt;br /&gt;
            integer c = ~-llFloor((llLog(a) / 0.69314718055994530941723212145818));//extremes will error towards extremes. following yuch corrects it.&lt;br /&gt;
            return (0x7FFFFF &amp;amp; (integer)(a * (0x1000000 &amp;gt;&amp;gt; b))) | (((c + 126 + (b = ((integer)a + -(3 &amp;lt;= (a *= llPow(2, -c)))))) * 0x800000 ) | b);&lt;br /&gt;
        }//the previous requires a lot of unwinding to understand it.&lt;br /&gt;
        return 0x7FC00000;//NaN time! We have no way to tell NaN&#039;s apart so lets just choose one.&lt;br /&gt;
    }&lt;br /&gt;
    return ((string)a == &amp;quot;-0.000000&amp;quot;) * 0x80000000;//for grins, detect the sign on zero. it&#039;s not pretty but it works.&lt;br /&gt;
}//Mono does not support indeterminates so I&#039;m not going to worry about it.&lt;br /&gt;
&lt;br /&gt;
float iuf(integer a)&lt;br /&gt;
{//union integer to float&lt;br /&gt;
    if(!(~a &amp;amp; 0x7F800000))&lt;br /&gt;
        return (float)llGetSubString(&amp;quot;-nan-inf&amp;quot;, 4 * !(a &amp;amp; 0x7FFFFF) + (a &amp;gt; (a^a)), 7);&lt;br /&gt;
    return llPow(2, (a | !a) + 0xffffff6a) * (((!!(a = (0xff &amp;amp; (a &amp;gt;&amp;gt; 23)))) * 0x800000) | ((a &amp;amp; 0x7fffff))) * (1 | (a &amp;gt;&amp;gt; 31));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Further possible optimizations include replacing other divisions with multiplications where possible (llLog(a) / 0.693... might be a candidate, but it&#039;s at the core of the algorithm so I didn&#039;t dare) and replacing &amp;lt;= with &amp;lt; in the (3 &amp;lt;= ...) if possible. If it&#039;s equivalent to (2 &amp;lt; ...) then the latter is preferable. Also, although I&#039;ve not touched them, source code wise, the floats used have an unnecessary precision; using respectively 2.3509887e-38, 1e-45, 3.4028235e+38, and 0.6931472, the results are the same. You can check that doing: float f1 = 2.3509887016445750159374730744445e-38; float f2 = 2.3509887e-38; if (f1 == f2) llOwnerSay(&amp;quot;yes&amp;quot;); outputs yes, and similarly for the rest. Doubles are not supported after all.&lt;br /&gt;
&lt;br /&gt;
For the sake of verifiability, here&#039;s my simpler test program (not the distributed one, although it&#039;s along the same lines):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
string tohex(integer i)&lt;br /&gt;
{&lt;br /&gt;
    string hex = &amp;quot;0123456789ABCDEF&amp;quot;;&lt;br /&gt;
    string result;&lt;br /&gt;
    integer iter = 9;&lt;br /&gt;
    while (--iter)&lt;br /&gt;
    {&lt;br /&gt;
        result = llGetSubString(hex, i &amp;amp; 0xF, i &amp;amp; 0xF) + result;&lt;br /&gt;
        i = i &amp;gt;&amp;gt; 4;&lt;br /&gt;
    }&lt;br /&gt;
    return result;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (fui(iuf(0x7F800000)) ^ 0x7F800000) llOwnerSay(&amp;quot;Fail at +inf&amp;quot;);&lt;br /&gt;
        if (fui(iuf(0xFF800000)) ^ 0xFF800000) llOwnerSay(&amp;quot;Fail at -inf&amp;quot;);&lt;br /&gt;
        if (fui(iuf(0x7FC00000)) ^ 0x7FC00000) llOwnerSay(&amp;quot;Fail at NaN1&amp;quot;);&lt;br /&gt;
        if (fui(iuf(0xFFC00000)) ^ 0x7FC00000) llOwnerSay(&amp;quot;Fail at NaN2&amp;quot;);&lt;br /&gt;
        if (fui(iuf(0x7FC0FFFF)) ^ 0x7FC00000) llOwnerSay(&amp;quot;Fail at NaN3&amp;quot;);&lt;br /&gt;
        if (fui(iuf(0xFFC00001)) ^ 0x7FC00000) llOwnerSay(&amp;quot;Fail at NaN4&amp;quot;);&lt;br /&gt;
        if (fui(iuf(0x00000000)) ^ 0x00000000) llOwnerSay(&amp;quot;Fail at 0.0&amp;quot;);&lt;br /&gt;
        if (fui(iuf(0x80000000)) ^ 0x80000000) llOwnerSay(&amp;quot;Fail at -0.0&amp;quot;);&lt;br /&gt;
        if (fui(iuf(0x00000001)) ^ 0x00000001) llOwnerSay(&amp;quot;Fail at 1e-45&amp;quot;);&lt;br /&gt;
        if (fui(iuf(0x80000001)) ^ 0x80000001) llOwnerSay(&amp;quot;Fail at -1e-45&amp;quot;);&lt;br /&gt;
        if (fui(iuf(0xFF7FFFFF)) ^ 0xFF7FFFFF) llOwnerSay(&amp;quot;Fail at ~ -1e38&amp;quot;);&lt;br /&gt;
        integer a;&lt;br /&gt;
        integer iter;&lt;br /&gt;
        while (++iter)&lt;br /&gt;
        {&lt;br /&gt;
            integer rand = (integer)llFrand(65536) + 65536 * (integer)llFrand(65536);&lt;br /&gt;
            if (!(iter &amp;amp; 0xFFFF)) llSetText((string)iter, &amp;lt;1,1,1&amp;gt;, 1);&lt;br /&gt;
&lt;br /&gt;
            if (fui(iuf(rand)) != rand) // we let it run for NaNs too to detect crashes&lt;br /&gt;
            {&lt;br /&gt;
                if (~rand &amp;amp; 0x7F800000)&lt;br /&gt;
                {&lt;br /&gt;
                    llSetText(&amp;quot;Fail at rand = 0x&amp;quot; + tohex(rand) + &amp;quot;, fui(iuf(rand)) = 0x&amp;quot; + tohex(fui(iuf(rand))), &amp;lt;1,1,1&amp;gt;,1);&lt;br /&gt;
                    return;&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        llSetText(&amp;quot;Done&amp;quot;, &amp;lt;1,1,1&amp;gt;, 1);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
I simply let it run while desired.&lt;br /&gt;
&lt;br /&gt;
--[[User:Pedro Oval|Pedro Oval]] 11:02, 15 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
:I hadn&#039;t seen your previous comment, thank you for pointing it out. I&#039;ll try to patch Float2Hex so it doesn&#039;t use exponents less than -127 (it use to work on Mono ~_~).&lt;br /&gt;
&lt;br /&gt;
:You are correct, the extra precision is unnecessary for single precision. I use these values because Float2Hex uses them, and I&#039;ve written versions of Float2Hex that support higher precisions. I wrote both originally in ESL (LSL fed through a C Pre-processor) with extensive use of macros.&lt;br /&gt;
&lt;br /&gt;
:I tend to optimize for LSO bytecode and stack size (I know it&#039;s insane but old habits die hard). Which is why I wasn&#039;t using llPow. I&#039;m not surprised there is a bytecode savings between 2 and 2.0 for Mono but is it really faster? I would have though the compiler would have put in the implicit typecast there... unless LL got smart... hmmm. Anyway we are well beyond optimizing for LSO.&lt;br /&gt;
&lt;br /&gt;
:You could try flipping the divide in the log2 calculation, I&#039;m not sure if the error recovery is good enough. My recollection from my initial testing was that using a multiply instead of the divide widened the range of the errors.&lt;br /&gt;
&lt;br /&gt;
:I never wanted to committing to inlining &amp;quot;-0.000000&amp;quot; in fear they might change the typecast on me. We won that fight a few years ago so it should be ok.&lt;br /&gt;
&lt;br /&gt;
:Quick question, what does the following do? Trying to figure out how screwed I am. I am hoping to avoid having Float2Hex revert to base 10 for |x| &amp;lt; 0x1p-127 (I don&#039;t even know of a good way to do that x_x).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;default {&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llOwnerSay((string)(0.0 != (float)&amp;quot;0x0.4p-127&amp;quot;));&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Unless testing proves otherwise, we don&#039;t want to swap in a multiplication for a shift, at the CPU level shift should be faster. Swapping a subtract out for an add-negation similarly won&#039;t give you much as negation would be an extra instruction (unless the negation is being done on a constant than it&#039;s no extra).&lt;br /&gt;
&lt;br /&gt;
:1e-45 makes me uneasy. I know it works but it just looks wrong to me. I am cool with excessive precision.&lt;br /&gt;
&lt;br /&gt;
:I&#039;ve made a few changes. I couldn&#039;t help myself. I used the dreaded negative indexing on llGetSubString, &#039;&#039;with wraparound&#039;&#039;. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 22:16, 16 February 2013 (PST)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
integer fui(float a)//Mono Safe, LSO Safe, Doubles Unsupported, LSLEditor Unsafe&lt;br /&gt;
{//union float to integer&lt;br /&gt;
    if(a){//is it nonzero?&lt;br /&gt;
        integer b = (a &amp;lt; 0) * 0x80000000;//the sign&lt;br /&gt;
        if((a = llFabs(a)) &amp;lt; 2.3509887016445750159374730744445e-38)//Denormalized range check &amp;amp; last stride of normalized range&lt;br /&gt;
            return b | (integer)(a / 1.4012984643248170709237295832899e-45);//the math overlaps; saves cpu time.&lt;br /&gt;
        if(a &amp;gt; 3.4028234663852885981170418348452e+38)//Round up to infinity&lt;br /&gt;
            return b | 0x7F800000;//Positive or negative infinity&lt;br /&gt;
        if(a &amp;gt; 1.4012984643248170709237295832899e-45){//It should at this point, except if it&#039;s NaN&lt;br /&gt;
            integer c = ~-llFloor(llLog(a) * 1.4426950408889634073599246810019);//extremes will error towards extremes. following yuch corrects it&lt;br /&gt;
            return b | (0x7FFFFF &amp;amp; (integer)(a * (0x1000000 &amp;gt;&amp;gt; c))) | ((126 + (c = ((integer)a - (3 &amp;lt;= (a *= llPow(2, -c))))) + c) * 0x800000);&lt;br /&gt;
        }//the previous requires a lot of unwinding to understand it.&lt;br /&gt;
        return 0x7FC00000;//NaN time! We have no way to tell NaN&#039;s apart so lets just choose one.&lt;br /&gt;
    }//Mono does not support indeterminates so I&#039;m not going to worry about them.&lt;br /&gt;
    return ((string)a == &amp;quot;-0.000000&amp;quot;) * 0x80000000;//for grins, detect the sign on zero. it&#039;s not pretty but it works.&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
float iuf(integer a)&lt;br /&gt;
{//union integer to float&lt;br /&gt;
    if(!(0x7F800000 &amp;amp; ~a))&lt;br /&gt;
        return (float)llGetSubString(&amp;quot;-infnan&amp;quot;, 3 * ~!(a &amp;amp; 0x7FFFFF), ~a &amp;gt;&amp;gt; 31);&lt;br /&gt;
    return llPow(2, (a | !a) + 0xffffff6a) * (((!!(a = (0xff &amp;amp; (a &amp;gt;&amp;gt; 23)))) * 0x800000) | (a &amp;amp; 0x7fffff)) * (1 | (a &amp;gt;&amp;gt; 31));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::The version with multiply turned out to work fine in a sample of ~600M random numbers, so yay! On the bad news side, the test program you asked me to run returns 0. As I said, 1p-127 returns 0 already, so no surprise there, but I tested this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay((string)(0.0 != (float)&amp;quot;0x0.ffffffp-126&amp;quot;));&lt;br /&gt;
        llOwnerSay((string)(0.0 != (float)&amp;quot;0x1.0p-126&amp;quot;));&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
::and got 0 and 1. So I&#039;m afraid hex notation refuses to produce any denormal at all. &amp;lt;strike&amp;gt;A strategy you can maybe use for denormals is to treat them as a special case multiplying them by a power of two, so they come into a tractable range. But I haven&#039;t checked the source so I may be off here.&amp;lt;/strike&amp;gt; (Oops, got your point now - there may be a way using part of the strategy I mention, I&#039;ll think about something)&lt;br /&gt;
&lt;br /&gt;
::As for optimizations, I like your &amp;quot;risky&amp;quot; rewriting of llGetSubString, and of course it works. I know mults are slower than shifts (if that&#039;s what the code is compiled to in the end, which is questionable), but the difference, just maybe ten cycles or so, is really unnoticeable when there&#039;s a whole burden of task switching and other stuff going on. For that reason I tend to always optimize for memory. In the above case, it will matter little if the function takes 30000 or 30010 cycles to execute, just as an example to make my point (I&#039;m sure the actual numbers will be different). Same with minus sign: the extra CPU burden will be insignificant (1 cycle probably). I&#039;ve tried to test these differences but I never got conclusive results because noise level exceeds signal level by far, which just proves how insignificant the difference is. I tend to run out of space in scripts so I mostly optimize for memory. While I get to 60K+ code size often, I have yet to run into an application where shoving cycles that way gains anything noticeable. Also, I started to test this for Omei because she intended to use it in a memory-tight application. The space savings can make a difference.&lt;br /&gt;
&lt;br /&gt;
::The int-to-float implicit conversion seems to add an explicit cast, as an int constant is 6 bytes, a float constant is 10, and an integer implicitly or explicitly cast to float takes 7. By the way, -~-x is a saving vs. 1-x and vs. 1+-x (1 byte per unary sign vs. 6 bytes the integer constant, 8 the subtraction and 4 the addition). I have Mono size measurements here: [[User:Pedro Oval/Mono code memory usage]].&lt;br /&gt;
&lt;br /&gt;
::As for the 1e-45, OK, though I like it because it also reflects the loss of precision that happens in denormals. But it&#039;s my opinion that using the whole expansion in the comparison to detect a NaN is overkill, as any number between 1e-45 and 2.35e-38 will do. For example, 1e-40 is equally valid and doesn&#039;t clobber the source so much. --[[User:Pedro Oval|Pedro Oval]] 19:36, 17 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
::Alas, it&#039;s worse than I thought. 1.17e-38 (a denormal) works fine, but (float)&amp;quot;1.17e-38&amp;quot; returns 0. Not sure when did glibc stop supporting denormals. --[[User:Pedro Oval|Pedro Oval]] 19:59, 17 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
:::I&#039;ve put -~- back. I can&#039;t thank you enough for all your testing. I totally agree, optimizing for size is the main concern. I didn&#039;t remember this about logarithms that log&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;b * log&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt;a = 1. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 21:38, 17 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
:::Crap. Both Float2Sci and Float2Hex are screwed. Without having access to the source for the Mono compiler we can&#039;t be sure it&#039;s glibc or Mono, though we can confirm it&#039;s glibc that&#039;s bugged by checking how it works with LSO. I may just have to manifest at an upcoming [[Simulator_User_Group|Simulator]]/[[Server_Beta_User_Group|Server_Beta]] User Group meeting and complain. should open up a ticket on jira first. hmmm. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::Duh, good point. It&#039;s a Mono-only quirk. (float)&amp;quot;0x1p-127&amp;quot;, (float)&amp;quot;0x1p-149&amp;quot;, and (float)&amp;quot;1e-45&amp;quot; are all nonzero in LSO, and the latter two are equal to 1e-45 as expected. About the latest change, I fail to see the gain in moving the sign of c to the &amp;lt;code&amp;gt;-~-llFloor&amp;lt;/code&amp;gt; line, as that forces a subtraction later which eats 4 extra bytes. Could it not remain as &amp;lt;code&amp;gt;integer c = ~-llFloor...&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;...llPow(2, -c))))) + c)&amp;lt;/code&amp;gt;? --[[User:Pedro Oval|Pedro Oval]] 20:23, 18 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
:::::Of course it can but why should it make a difference as we have just moved the negation further down. Am I missing something? Please tell me that subtraction isn&#039;t more expensive than addition. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 21:47, 18 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
::::::Sorry to bring bad news but yes: addition of two local integers takes 4 bytes, as does multiplication. But subtraction takes 8, as do division, mod and shift. &amp;quot;!&amp;quot; takes 3 bytes, while &amp;quot;~&amp;quot; and &amp;quot;-&amp;quot; take 1 each. Take a look at the table I linked to. You&#039;ll want to cry. As for the several variants you enumerate below, regrettably, float to integer cast takes 5 bytes, which is more than leaving it as &amp;lt;= instead of &amp;lt; (3 extra bytes). I think function calls need at least as many bytes as their name, so I wouldn&#039;t go that route. Not 100% sure there though. Converting x-y to x+-y saves 3 bytes. --[[User:Pedro Oval|Pedro Oval]] 14:31, 19 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
:Oh yeah, ((integer)x - (3 &amp;lt;= x)) is equivalent to...&lt;br /&gt;
:* (integer)x - (2 &amp;lt; (integer)(x))&lt;br /&gt;
:* (integer)x - (((integer)(x)) == 3)&lt;br /&gt;
:* (integer)x + (((integer)(x)) / -3)&lt;br /&gt;
:* (integer)x - !(3 &amp;amp; ~(integer)(x))&lt;br /&gt;
:* (integer)x - (2 &amp;lt; llFloor(x))&lt;br /&gt;
:* (integer)x - ((llFloor(x)) == 3)&lt;br /&gt;
:* (integer)x + ((llFloor(x)) / -3)&lt;br /&gt;
:* (integer)x - !(3 &amp;amp; ~llFloor(x))&lt;br /&gt;
: the value of x will always be in the range [0.5, 4). Truncating or rounding it down to an integer result in it being in the range [0, 3], we want to further truncate this range to [0, 2]. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 22:33, 18 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
:* (integer)x + (integer)(x * -0.3333333432674407958984375)&lt;br /&gt;
:* (integer)x - (2.9999997615814208984375 &amp;lt; x))&lt;br /&gt;
&lt;br /&gt;
:Another reason for the excessive precision, I test a lot of code in LSLEditor, which uses doubles. If I want things to work I have to keep my constants in double precision land. I calculate most of them with the windows calculator and then just copy and paste. That way when I paste them back into the windows calculator I can work the math backwards and figure out where the constants came from. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 23:43, 18 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
== too many (, or not enough ) ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
return (0x3FF &amp;amp; (integer)(a * (0x800 &amp;gt;&amp;gt; b))) | (((c + (b = ((integer)a - (3 &amp;lt;= (a *= (0.0000152587890625 * (0x40000000 &amp;gt;&amp;gt; c)))))) &amp;lt;&amp;lt; 10 ) | b);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
count(&amp;quot;(&amp;quot;) != count(&amp;quot;)&amp;quot;) [[User:Cron Stardust|Cron Stardust]] 07:04, 27 June 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
:I think that&#039;s a left over from a last minute refactoring. Fixed. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 20:36, 27 June 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
:: Thanks! :D [[User:Cron Stardust|Cron Stardust]] 20:55, 27 June 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Indeterminates ==&lt;br /&gt;
&lt;br /&gt;
There&#039;s one more value that can be encoded and read back: indeterminate. Indeterminate values have a representation of FFC00000, see http://babbage.cs.qc.edu/courses/cs341/IEEE-754references.html#kevin_chart. They can be read through llList2CSV and they show as -nan. &amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        float a=(float)&amp;quot;nan&amp;quot;;&lt;br /&gt;
        llOwnerSay(llList2CSV([&amp;quot;(float)\&amp;quot;nan\&amp;quot;&amp;quot;, a]));&lt;br /&gt;
        a=-a;&lt;br /&gt;
        llOwnerSay(llList2CSV([&amp;quot;-a&amp;quot;, a]));&lt;br /&gt;
        a=(float)&amp;quot;inf&amp;quot;*0;&lt;br /&gt;
        llOwnerSay(llList2CSV([&amp;quot;inf*0&amp;quot;,a]));&lt;br /&gt;
        a=llAcos(2);&lt;br /&gt;
        llOwnerSay(llList2CSV([&amp;quot;acos(2)&amp;quot;,a]));&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
/*outputs:&lt;br /&gt;
[08:05:05] Object: (float)&amp;quot;nan&amp;quot;, nan&lt;br /&gt;
[08:05:05] Object: -a, -nan&lt;br /&gt;
[08:05:05] Object: inf*0, -nan&lt;br /&gt;
[08:05:05] Object: acos(2), nan&lt;br /&gt;
*/&amp;lt;/source&amp;gt; (float)&amp;quot;-nan&amp;quot; does not work :( --[[User:Sei Lisa|Sei Lisa]] ([[User talk:Sei Lisa|talk]]) 08:06, 6 September 2015 (PDT)&lt;br /&gt;
&lt;br /&gt;
:I think I knew (float)&amp;quot;-nan&amp;quot; was borked, can&#039;t really do anything about it. I guess I&#039;ll multiple +/-inf by zero or one for the -nan generation. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 17:05, 6 September 2015 (PDT)&lt;br /&gt;
&lt;br /&gt;
::It should be better now. Haven&#039;t compiled it. Probably should. No time now. Half-precision won&#039;t work right, it needs some TLC. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 17:45, 6 September 2015 (PDT)&lt;br /&gt;
&lt;br /&gt;
:::Thanks a lot! fui is working perfectly, but iuf can&#039;t produce nan, only -nan. If it helps, I&#039;ve found that while (float)&amp;quot;-nan&amp;quot; doesn&#039;t work, -(float)&amp;quot;nan&amp;quot; and -1*(float)&amp;quot;nan&amp;quot; do.--[[User:Sei Lisa|Sei Lisa]] ([[User talk:Sei Lisa|talk]]) 18:34, 6 September 2015 (PDT)&lt;br /&gt;
:::Correction. (-1)*(float)&amp;quot;nan&amp;quot; doesn&#039;t produce -nan. The parentheses were important.--[[User:Sei Lisa|Sei Lisa]] ([[User talk:Sei Lisa|talk]]) 08:21, 9 September 2015 (PDT)&lt;br /&gt;
&lt;br /&gt;
::::That makes some perverse sense. I&#039;ll log in sometime this weekend and figure out a way to do this (hopefully without using a branch). -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 15:26, 12 September 2015 (PDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== FUI2HexFloat ==&lt;br /&gt;
This fuction can t be compiled .&lt;br /&gt;
Error at the line if(e ^ 127)&lt;br /&gt;
e is a variable declared later &lt;br /&gt;
&lt;br /&gt;
[[User:Miranda Umino|Miranda Umino]] ([[User talk:Miranda Umino|talk]]) 11:28, 14 September 2015 (PDT)&lt;br /&gt;
&lt;br /&gt;
:it should compile now but it needs testing. --&#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 13:39, 14 September 2015 (PDT)&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User_talk:Strife_Onizuka/Float_Functions&amp;diff=1197517</id>
		<title>User talk:Strife Onizuka/Float Functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User_talk:Strife_Onizuka/Float_Functions&amp;diff=1197517"/>
		<updated>2015-09-19T12:41:49Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: /* Try these */ Comment on test results of (float)&amp;quot;denormal&amp;quot; and (vector)&amp;quot;&amp;lt;denormal...&amp;gt;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Ever considered making a fui16? ==&lt;br /&gt;
&lt;br /&gt;
I was just looking around for how I could union a float into a 16 bit integer, perhaps using the [http://en.wikipedia.org/wiki/Half-precision_floating-point_format IEEE 754-2008 half-precision] format.  Yes, I know there would be losses, and I also know that SL olny has 32 bit integers.  The final goal for my application is to pack two floats into a single integer, via bitshifting the first into the high range and then ORing with the second, a la:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// To pack:&lt;br /&gt;
float a = PI;&lt;br /&gt;
float b = 4.2;&lt;br /&gt;
integer result = (fui16(a) &amp;lt;&amp;lt; 0x10) | fui16(b);&lt;br /&gt;
&lt;br /&gt;
// To unpack:&lt;br /&gt;
float c = i16uf(result &amp;gt;&amp;gt; 0x10); // Might need to perform some further magic here to account for the fact that the sign bit doesn&#039;t shift.&lt;br /&gt;
float d = i16uf(result &amp;amp; 0xFFFF);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Of course, in the general case one can&#039;t make assumptions about range and resolution.  That said, in my application I &#039;&#039;can&#039;&#039; make such assumptions, and I&#039;m just going to hack together something that works based on those assumptions.  I&#039;m just here feeding the fetish that resulted in these very-useful-to-me functions (fui, iuf) in the first place. &amp;gt;:D&lt;br /&gt;
&lt;br /&gt;
{{Unsigned|Cron Stardust}}&lt;br /&gt;
&lt;br /&gt;
:Lets see, I could either work on [[Template:LSL Function]] et al as to split the notes section in half, or I could write fui16 a most clever function. Hmmm. Fun clever coding or Template drudge. Half precision doesn&#039;t have the same range, grrrr... -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 20:57, 24 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
:Upon second though, I really don&#039;t want to dig into floating point math at the moment. Mostly you just need to add clipping to fui, change the constants and add infinity support to iuf. With clipping implemented the error correcting code can be removed. Here is my first crack at updating the constants. I&#039;ve not tested it. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 21:35, 24 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
integer fui16(float a)//Mono Safe, LSO Safe, Doubles Unsupported, LSLEditor Unsafe&lt;br /&gt;
{//union half-precision float to short integer &lt;br /&gt;
    if((a)){//is it non zero?&lt;br /&gt;
        integer b = (integer)(a &amp;lt; 0) &amp;lt;&amp;lt; 15;//the sign, but later this variable is reused to store the shift&lt;br /&gt;
        if((a = llFabs(a)) &amp;lt; 0.0001220703125)//Denormalized range check &amp;amp; last stride of normalized range&lt;br /&gt;
            return b | (integer)(a * 16777216.0);//the math overlaps; saves cpu time.&lt;br /&gt;
        if(a &amp;gt; 65504.0)//Round up to infinity&lt;br /&gt;
            return b | 0x7C00;//Positive or negative infinity&lt;br /&gt;
        integer c = llFloor((llLog(a) / 0.69314718055994530941723212145818)) + 14;//extremes will error towards extremes. following yuch corrects it.&lt;br /&gt;
        return (0x3FF &amp;amp; (integer)(a * (0x800 &amp;gt;&amp;gt; b))) | (((c + (b = (integer)(a *= (0.0000152587890625 * (0x40000000 &amp;gt;&amp;gt; c))))) &amp;lt;&amp;lt; 10 ) | b);&lt;br /&gt;
    }//for grins, detect the sign on zero. it&#039;s not pretty but it works. the previous requires a lot of unwinding to understand it.&lt;br /&gt;
    return (integer)((string)a == (string)(-0.0)) &amp;lt;&amp;lt; 15;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
float i16uf(integer a)&lt;br /&gt;
{//union short integer to half-precision float&lt;br /&gt;
    if((a &amp;amp; 0x7C00) == 0x7C00)&lt;br /&gt;
        return (1 | ((a &amp;lt;&amp;lt; 16) &amp;gt;&amp;gt; 31)) * (float)&amp;quot;Infinity&amp;quot;;&lt;br /&gt;
    return 0.000000059604644775390625 * (1 &amp;lt;&amp;lt; (a - !!a)) * ((!!(a = (0x1f &amp;amp; (a &amp;gt;&amp;gt; 10))) &amp;lt;&amp;lt; 10) | ((a &amp;amp; 0x3ff))) * (1 | ((a &amp;lt;&amp;lt; 16) &amp;gt;&amp;gt; 31));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// To pack:&lt;br /&gt;
float a = PI;&lt;br /&gt;
float b = 4.2;&lt;br /&gt;
integer result = (fui16(a) &amp;lt;&amp;lt; 16) | fui16(b);&lt;br /&gt;
 &lt;br /&gt;
// To unpack:&lt;br /&gt;
float c = i16uf(result &amp;gt;&amp;gt; 16); // No magic needed, sign bit is handled correctly.&lt;br /&gt;
float d = i16uf(result);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
::Just tested in SL with the following results: Had to place a closing paren in the first return statement of iuf16, I placed it just before the mult as I suspect that&#039;s what was intended. I wrote a simple ownersay of the existing test code which gave the following as the output: [[User:Cron Stardust|Cron Stardust]] 16:12, 25 December 2012 (PST)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
  a = 3.141593 = 0xC90FDBp-22&lt;br /&gt;
= c = 3.140625 = 0xC9p-6&lt;br /&gt;
  b = 4.200000 = 0x433333p-20&lt;br /&gt;
= d = 4.199219 = 0x433p-8&amp;lt;/source&amp;gt;&lt;br /&gt;
::Further testing, looking for error cases, resulted in a lot of good: the functions seem to operate as they should.  I tested using all the constants demonstrated on the Wikipedia article and only one failed to match perfectly: 0.0000000596046 doesn&#039;t encode to 0x0001, instead it results in 0x0000. All other values seem to work great. [[User:Cron Stardust|Cron Stardust]] 22:00, 25 December 2012 (PST)&lt;br /&gt;
:: Also tested that with &amp;lt;code&amp;gt;a = -2.0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;b = -2.0&amp;lt;/code&amp;gt; that everything works out: no issues happen with the sign bit status that I could detect - so I took the liberty of changing the comment in your code. [[User:Cron Stardust|Cron Stardust]] 22:34, 25 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
:::I&#039;m willing to bet it&#039;s a lack of precision in their approximation. Try: 0.000000059604644775390625 -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 00:36, 26 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
:::I&#039;m not 100% sure of the &amp;quot;&amp;lt;code&amp;gt;llFloor((llLog(a) / 0.6931471...)&amp;lt;/code&amp;gt;&amp;quot; line but I think in this range it&#039;s accurate and we don&#039;t need to do any correction. The only way to know for sure is to try every value in the range [0.0001220703125, 65504.0]. I know it&#039;s not going to overflow so I&#039;ve removed the overflow protection code. If you want to do that testing, here is the return line you would use which assumes that &amp;quot;c&amp;quot; is accurate: &amp;lt;code&amp;gt;return (0x3FF &amp;amp; (integer)((a / (float)(&amp;quot;0x.004p&amp;quot;+(string)c)))) | (((c + 15) &amp;lt;&amp;lt; 10 ) | b);&amp;lt;/code&amp;gt; It has the added bonus of making fui16 LSLEditor safe. This was also a good demonstration of how the layers of correction code were bolted on. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 00:50, 26 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
This is a better version of what I was talking about but it needs extensive testing. If c is not accurate this will not work.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
		integer c = llFloor((llLog(a) / 0.69314718055994530941723212145818)) + 15;//extremes will error towards extremes. No corrections are attempted.&lt;br /&gt;
		return (0x3FF &amp;amp; (integer)((a * 0.03125 * (0x40000000 &amp;gt;&amp;gt; c)))) | ((c &amp;lt;&amp;lt; 10) | b);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
I&#039;ve gone back and removed my string-float pow code since it can all be done with integers and float math. Faster this way. Less stressful for the sim.&lt;br /&gt;
-- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 01:32, 26 December 2012 (PST)&lt;br /&gt;
=== Testing ===&lt;br /&gt;
Just run the following code and it will tell you if c is accurate for the entire half-precision range (this is one of the things iuf is really good for, iterating over every float value). -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 02:55, 26 December 2012 (PST)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
integer fui(float a)//Mono Safe, LSO Safe, Doubles Unsupported, LSLEditor Unsafe&lt;br /&gt;
{//union float to integer&lt;br /&gt;
    if((a))&lt;br /&gt;
    {//is it non zero?&lt;br /&gt;
        integer b = (a &amp;lt; 0) &amp;lt;&amp;lt; 31;//the sign, but later this variable is reused to store the shift&lt;br /&gt;
        if((a = llFabs(a)) &amp;lt; 2.3509887016445750159374730744445e-38)//Denormalized range check &amp;amp; last stride of normalized range&lt;br /&gt;
            return b | (integer)(a / 1.4012984643248170709237295832899e-45);//the math overlaps; saves cpu time.&lt;br /&gt;
        integer c = llFloor((llLog(a) / 0.69314718055994530941723212145818));//extremes will error towards extremes. following yuch corrects it.&lt;br /&gt;
        return (0x7FFFFF &amp;amp; (integer)(a * (0x1000000 &amp;gt;&amp;gt; b))) | (((c + 126 + (b = ((integer)a - (3 &amp;lt;= (a /= (float)(&amp;quot;0x1p&amp;quot;+(string)(c -= ((c &amp;gt;&amp;gt; 31) | 1)))))))) &amp;lt;&amp;lt; 23 ) | b);&lt;br /&gt;
    }//for grins, detect the sign on zero. it&#039;s not pretty but it works. the previous requires a lot of unwinding to understand it.&lt;br /&gt;
    return ((string)a == (string)(-0.0)) &amp;lt;&amp;lt; 31;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
float iuf(integer a)&lt;br /&gt;
{//union integer to float&lt;br /&gt;
    return ((float)(&amp;quot;0x1p&amp;quot;+(string)((a | !a) - 150))) * ((!!(a = (0xff &amp;amp; (a &amp;gt;&amp;gt; 23))) &amp;lt;&amp;lt; 23) | ((a &amp;amp; 0x7fffff))) * (1 | (a &amp;gt;&amp;gt; 31));&lt;br /&gt;
}//will crash if the raw exponent == 0xff; reason for crash deviates from float standard; though a crash is warranted.&lt;br /&gt;
&lt;br /&gt;
integer test(float a)//Mono Safe, LSO Safe, Doubles Unsupported, LSLEditor Unsafe&lt;br /&gt;
{//union half-precision float to short integer &lt;br /&gt;
    if((a))&lt;br /&gt;
    {//is it non zero?&lt;br /&gt;
        if((a = llFabs(a)) &amp;lt; 0.0001220703125)//Denormalized range check &amp;amp; last stride of normalized range&lt;br /&gt;
            return FALSE;//the math overlaps; saves cpu time.&lt;br /&gt;
        if(a &amp;gt; 65504.0)//Round up to infinity&lt;br /&gt;
            return FALSE;//Positive or negative infinity&lt;br /&gt;
        integer c = llFloor((llLog(a) / 0.69314718055994530941723212145818)) + 14;//extremes will error towards extremes. following yuch corrects it.&lt;br /&gt;
        return (integer)(a *= (0.0000152587890625 * (0x40000000 &amp;gt;&amp;gt; c))) - 1;&lt;br /&gt;
    }//for grins, detect the sign on zero. it&#039;s not pretty but it works. the previous requires a lot of unwinding to understand it.&lt;br /&gt;
    return FALSE;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
float i16uf(integer a)&lt;br /&gt;
{//union short integer to half-precision float&lt;br /&gt;
    if((a &amp;amp; 0x7C00) == 0x7C00)&lt;br /&gt;
        return (1 | ((a &amp;lt;&amp;lt; 16) &amp;gt;&amp;gt; 31)) * (float)&amp;quot;Infinity&amp;quot;;&lt;br /&gt;
    return 0.000000059604644775390625 * (1 &amp;lt;&amp;lt; (a - !!a)) * ((!!(a = (0x1f &amp;amp; (a &amp;gt;&amp;gt; 10))) &amp;lt;&amp;lt; 10) | ((a &amp;amp; 0x3ff))) * (1 | ((a &amp;lt;&amp;lt; 16) &amp;gt;&amp;gt; 31));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
list gBadBlockCounts;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;beginning test&amp;quot;);llResetTime();&lt;br /&gt;
        &lt;br /&gt;
        integer badCount = 0;&lt;br /&gt;
        integer badStart;&lt;br /&gt;
        &lt;br /&gt;
        integer start = fui(i16uf(1) / 2.0);//start just before min value, these will get clipped to zero.&lt;br /&gt;
        integer end = fui(65536.0);//stop just after infinity&lt;br /&gt;
        integer i;&lt;br /&gt;
        for(i = start;i &amp;lt; end; i++)&lt;br /&gt;
            if(test(iuf(i)))&lt;br /&gt;
            {&lt;br /&gt;
                llSetText(&amp;quot;bad:  &amp;quot;+(string)i, &amp;lt;1.0, 0.0, 0.0&amp;gt;, 1.0);&lt;br /&gt;
                if (badCount++ &amp;lt;= 0)&lt;br /&gt;
                {&lt;br /&gt;
                    badStart = i;&lt;br /&gt;
                    llOwnerSay(&amp;quot;Found bad number: &amp;quot; + (string) i);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llSetText(&amp;quot;good: &amp;quot;+(string)i, &amp;lt;0.0, 1.0, 0.0&amp;gt;, 1.0);&lt;br /&gt;
                if (badCount &amp;gt; 0)&lt;br /&gt;
                {&lt;br /&gt;
                    llOwnerSay(&amp;quot;Total of &amp;quot; + (string) badCount + &amp;quot; numbers, ending with &amp;quot; + (string) (i-1));&lt;br /&gt;
                    gBadBlockCounts = [badStart, i - 1] + gBadBlockCounts;&lt;br /&gt;
                    badCount = 0;&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        llSetText(&amp;quot;test complete.\ntook &amp;quot; + (string) llGetTime() + &amp;quot; secs over &amp;quot; + (string) (end - start) + &amp;quot; values\nsaw &amp;quot; + (string) llGetListLength(gBadBlockCounts) + &amp;quot; bad blocks.\nTouch for list of bad.&amp;quot;, &amp;lt;0.0, 1.0, 1.0&amp;gt;, 1.0);&lt;br /&gt;
        state printout;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state printout&lt;br /&gt;
{&lt;br /&gt;
    touch_end(integer index)&lt;br /&gt;
    {&lt;br /&gt;
        while (--index &amp;gt;= 0)&lt;br /&gt;
        {&lt;br /&gt;
            if (llGetListLength(gBadBlockCounts))&lt;br /&gt;
            {&lt;br /&gt;
                llRegionSayTo(llDetectedKey(index), 0,&lt;br /&gt;
                    &amp;quot;Bad blocks strided list, using stride pattern (block_start, block_end):&amp;quot;&lt;br /&gt;
                );&lt;br /&gt;
                llRegionSayTo(llDetectedKey(index), 0,&lt;br /&gt;
                    llDumpList2String(gBadBlockCounts, &amp;quot;, &amp;quot;)&lt;br /&gt;
                );&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llRegionSayTo(llDetectedKey(index), 0,&lt;br /&gt;
                    &amp;quot;Nothing to report.&amp;quot;&lt;br /&gt;
                );&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
::Tested this morning.  Went bad at values 864026624 through 900508790.  Not sure if there were further values: I set it up to run and then wen to work for the day, when I came back it had been yelling for a very long time... :P  Will see what I can do, however while I can understand the code, I&#039;ve not yet been able to get my mind in deep enough to understand the algorithm. [[User:Cron Stardust|Cron Stardust]] 18:55, 26 December 2012 (PST)  EDIT: Just noticed that there was a function named test in there that wasn&#039;t used: I&#039;d pasted in the fui16 function from above to make the code compile and run.  That may have invalidated the test, so I&#039;ve going to retest usung the &amp;quot;test&amp;quot; function in place of the fui16 call in state_entry.  I&#039;ve edited the above state_entry to reflect my current code.&lt;br /&gt;
::Just passed the 864026624 mark without errors, so yes: my previous test was invalid.  Continuing testing - just like GLaDOS likes. [[User:Cron Stardust|Cron Stardust]] 20:59, 26 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
:::I should have thought of this sooner, we don&#039;t need to test every value, just the ones who&#039;s values surround where the value of &amp;quot;c&amp;quot; changes. We only need to test ummm 84 values... just the powers of two and the immediate lesser values. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 01:44, 27 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
integer fui(float a)//Mono Safe, LSO Safe, Doubles Unsupported, LSLEditor Unsafe&lt;br /&gt;
{//union float to integer&lt;br /&gt;
    if((a))&lt;br /&gt;
    {//is it non zero?&lt;br /&gt;
        integer b = (integer)(a &amp;lt; 0) &amp;lt;&amp;lt; 31;//the sign, but later this variable is reused to store the shift&lt;br /&gt;
        if((a = llFabs(a)) &amp;lt; 2.3509887016445750159374730744445e-38)//Denormalized range check &amp;amp; last stride of normalized range&lt;br /&gt;
            return b | (integer)(a / 1.4012984643248170709237295832899e-45);//the math overlaps; saves cpu time.&lt;br /&gt;
        integer c = llFloor((llLog(a) / 0.69314718055994530941723212145818));//extremes will error towards extremes. following yuch corrects it.&lt;br /&gt;
        a /= (float)(&amp;quot;0x1p&amp;quot;+(string)(c -= ((c &amp;gt;&amp;gt; 31) | 1)));&lt;br /&gt;
        integer bb = ((integer)a - (3 &amp;lt;= a));&lt;br /&gt;
        return (0x7FFFFF &amp;amp; (integer)(a * (0x1000000 &amp;gt;&amp;gt; bb))) | (((c + 126 + bb) &amp;lt;&amp;lt; 23 ) | b);&lt;br /&gt;
    }//for grins, detect the sign on zero. it&#039;s not pretty but it works. the previous requires a lot of unwinding to understand it.&lt;br /&gt;
    return (integer)((string)a == (string)(-0.0)) &amp;lt;&amp;lt; 31;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
float iuf(integer a)&lt;br /&gt;
{//union integer to float&lt;br /&gt;
    integer aa = 0xff &amp;amp; (a &amp;gt;&amp;gt; 23);&lt;br /&gt;
    return ((float)(&amp;quot;0x1p&amp;quot;+(string)((aa | !aa) - 150))) * ((!!aa &amp;lt;&amp;lt; 23) | ((a &amp;amp; 0x7fffff))) * (1 | (a &amp;gt;&amp;gt; 31));&lt;br /&gt;
}//will crash if the raw exponent == 0xff; reason for crash deviates from float standard; though a crash is warranted.&lt;br /&gt;
&lt;br /&gt;
integer get_log2(float a)&lt;br /&gt;
{//we use the natural log because testing showed it&#039;s more accurate than log10.&lt;br /&gt;
    return llFloor((llLog(a) / 0.69314718055994530941723212145818));//must be divide, multiplying the reciprocal adds extra corruption.&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer test_log2(integer power)&lt;br /&gt;
{&lt;br /&gt;
    float a = (float)(&amp;quot;0x1p&amp;quot;+(string)power);&lt;br /&gt;
    float b = iuf(fui(a) - 1);//The underflow is in our favor and does what we want.&lt;br /&gt;
    integer c = get_log2(a);&lt;br /&gt;
    integer d = get_log2(b);&lt;br /&gt;
    integer e = (c == power) &amp;amp;&amp;amp; ((d + 1) == power);&lt;br /&gt;
//    llOwnerSay(llList2CSV([power, c, d, Float2Hex(a), Float2Hex(b), int2hexdword(fui(a)), int2hexdword(fui(b)), e]));&lt;br /&gt;
    return e;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        integer start = -25;&lt;br /&gt;
        integer end = 17;&lt;br /&gt;
        integer i;&lt;br /&gt;
        for(i = start; i &amp;lt;= end; i++)&lt;br /&gt;
            if(!test_log2(i))&lt;br /&gt;
                llOwnerSay((string)i);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
:: Ok, so executed - though I&#039;m leaving the other script running, and it seems good thus far; will report when it completes.  The results from this new test are that I saw values reported in the following ranges: [-25, -16], -14, [-12, -2], [3, 17] -- [[User:Cron Stardust|Cron Stardust]] 19:14, 27 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
::: Well that is bad. Guess c is not accurate so we can&#039;t remove the correction code (the overflow code can still be removed). I wonder what happens if you feed it NaN. Probably need a special case just for that. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 20:45, 27 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
::: I remembered how the correction code works and I fused one of the moving parts. I don&#039;t think it&#039;s necessary for this range but I&#039;m adding it back in. Since &amp;quot;c&amp;quot; could be off by one in either direction, this gives us three possible outcomes when generating new-a.&lt;br /&gt;
:::# It&#039;s too small, the result is that new-a is in range [0.5, 1)&lt;br /&gt;
:::# C is correct, new-a is in range [1, 2)&lt;br /&gt;
:::# It&#039;s too big, the result is that new-a is in range [2,4)&lt;br /&gt;
:::Solution? Map these three outcomes to three consecutive values so that they can be used to adjust c. Truncating new-a gives us [0.5, 1)-&amp;gt;0, [1, 2)-&amp;gt;1, [2,4)-&amp;gt;{2,3}. Yes they are consecutive but we need to map the final set to a single value. Hence the subtract by (3 &amp;lt;= a).&lt;br /&gt;
:::It&#039;s a shame I never documented which edge cases this code fixed. It would take a lot of the guess work out. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 21:22, 27 December 2012 (PST)&lt;br /&gt;
: For what it&#039;s worth, the old test code finally completed!  Took about 6-8 days continuous* calculation in my home region. (* script reported 521479.8 seconds, but I&#039;d had to stop and fix a UI error after several hours of computation, and picked up where I&#039;d left off.)  Here&#039;s the report: [[User:Cron Stardust|Cron Stardust]] 18:14, 5 January 2013 (PST)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Bad blocks list, using stride pattern [block_start, block_end]:&lt;br /&gt;
[&lt;br /&gt;
 [1191182336, 1191182336], [1182793721, 1182793727], [1174405120, 1174405120], [1166016505, 1166016511], &lt;br /&gt;
 [1157627901, 1157627903], [1149239293, 1149239295], [1140850685, 1140850687], [1132462077, 1132462079], &lt;br /&gt;
 [1124073469, 1124073471], [1115684861, 1115684863], [1107296255, 1107296255], [1098907647, 1098907647], &lt;br /&gt;
 [1090519039, 1090519039], [1048575999, 1048575999], [1040187390, 1040187391], [1031798782, 1031798783], &lt;br /&gt;
 [1023410174, 1023410175], [1015021564, 1015021567], [1006632956, 1006632959], [ 998244348,  998244351], &lt;br /&gt;
 [ 989855740,  989855743], [ 981467132,  981467135], [ 973078524,  973078527], [ 964689912,  964689919]&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== fui support for NaN and Inf ==&lt;br /&gt;
&lt;br /&gt;
I must be one of the few people who have found an actual use to fui :) I&#039;m using it for compact lossless transmission of floats over HTTP to a PHP server in base 64 (after removing the == and the trailing A&#039;s), and I decode it in the server using unpack() and some string manipulation. I would love to see fui support NaN, Inf and -Inf, but more for the sake of completion than because I have a real use (except possibly debugging). Maybe it&#039;s as straightforward as adding this on top?&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
  if ((string)a == &amp;quot;Infinity&amp;quot;) return 0x7F800000;&lt;br /&gt;
  if ((string)a == &amp;quot;-Infinity&amp;quot;) return 0xFF800000;&lt;br /&gt;
  if ((string)a == &amp;quot;NaN&amp;quot;) return 0x7FC00000; // to choose one&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
I guess there&#039;s no way to extract the actual bits of a NaN, or is there? --[[User:Pedro Oval|Pedro Oval]] 05:09, 26 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
Oops, I&#039;ve corrected &amp;quot;Inf&amp;quot; to read &amp;quot;Infinity&amp;quot; above. --[[User:Pedro Oval|Pedro Oval]] 07:58, 26 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
:Sure, I don&#039;t see why not. I&#039;ll think about ways of doing it (I&#039;m not sure if successive tests is really the best way of doing so). The reason Infinity was never handled was that LSO doesn&#039;t allow it. These functions were originally conceived before Mono was on the horizon (at the time I had wanted to build an LSO bytecode emulator in LSL). -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 01:01, 27 December 2012 (PST)&lt;br /&gt;
:It&#039;s done. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 22:43, 27 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
::You will be pleased (or horrified) to see that [[Float2Hex]] and [[Float2Sci]] both support NaN and Infinities now. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 00:22, 29 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
== Alternate code ==&lt;br /&gt;
&lt;br /&gt;
I was pondering alternate ways to &amp;lt;code&amp;gt;b &amp;gt;&amp;gt; (13 + ((b &amp;amp; 0x3FFF) == 0x2000))&amp;lt;/code&amp;gt; because it&#039;s just so ugly.&lt;br /&gt;
*&amp;lt;code&amp;gt;b &amp;gt;&amp;gt; (((0x3FFF &amp;amp; b ^ 0x1FFF) + 0x34001) &amp;gt;&amp;gt; 14)&amp;lt;/code&amp;gt; - we flip the low bits, so if all of them are on, that is to say our condition has been met, adding one will cause a carry into the 14th bit.&lt;br /&gt;
*&amp;lt;code&amp;gt;b &amp;gt;&amp;gt; ((0x38000 - (0x3FFF &amp;amp; b ^ 0x2000)) &amp;gt;&amp;gt; 14)&amp;lt;/code&amp;gt; - similar to above, we turn the high bit off, so if it&#039;s zero it doesn&#039;t cause a carry from above.&lt;br /&gt;
*&amp;lt;code&amp;gt;b / ((((0x3FFF &amp;amp; b ^ 0x1FFF) + 0x4001) &amp;amp; 0xC000) &amp;gt;&amp;gt; 1)&amp;lt;/code&amp;gt;&lt;br /&gt;
It&#039;s a shame there isn&#039;t a way to further improve it. It&#039;s an ugly mess that only gets uglier. ~_~ -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 23:22, 28 December 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
= Bugs in iuf and fui =&lt;br /&gt;
== Bug in iuf ==&lt;br /&gt;
&lt;br /&gt;
iuf does not support exponent parts of 2&amp;lt;sup&amp;gt;-104&amp;lt;/sup&amp;gt; or below. The reason is that in an intermediate step, it is trying to calculate 0x1p-127 or below, which yields 0. For exaple, iuf(0x0bffffff) returns 0, while iuf(0x0c00000) returns the correct result.&lt;br /&gt;
&lt;br /&gt;
Rather than trying to find a fix, I created my own iuf that seems to work, even if it&#039;s unoptimized and not very fast (though it contains a small trick to reduce the total number of iterations to a maximum of 25 or so):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
float iuf(integer e)&lt;br /&gt;
{&lt;br /&gt;
    float result = e &amp;amp; 0x7FFFFF;&lt;br /&gt;
    integer sign = e &amp;amp; 0x80000000;&lt;br /&gt;
    e = ((e &amp;gt;&amp;gt; 23) &amp;amp; 0xFF) + -150;&lt;br /&gt;
    // deal with Inf/NaN&lt;br /&gt;
    if (e == 105) { if (result) return (float)&amp;quot;NaN&amp;quot;; if (sign) return (float)&amp;quot;-Inf&amp;quot;; return (float)&amp;quot;Inf&amp;quot;; }&lt;br /&gt;
    if (e ^ -150)&lt;br /&gt;
    {&lt;br /&gt;
        result += 0x800000;&lt;br /&gt;
        while (e &amp;gt; 9) { result *= 512; e += -9; }&lt;br /&gt;
        while (e &amp;lt; -9) { result *= 0.001953125; e += 9; }&lt;br /&gt;
        while (e &amp;gt; 0) { result *= 2; --e; }&lt;br /&gt;
        while (e &amp;lt; 0) { result *= 0.5; ++e; }&lt;br /&gt;
        if (sign) return -result;&lt;br /&gt;
        return result;&lt;br /&gt;
    }&lt;br /&gt;
    if (sign) return -(result*1e-45);&lt;br /&gt;
    return result*1e-45;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A fix might be along the lines of not applying the -23 offset in advance (as usage of -150 implies) but postmultiplying by 2^-23 instead. I haven&#039;t tried though. --[[User:Pedro Oval|Pedro Oval]] 09:37, 8 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:If the denormalized range isn&#039;t working then Float2Hex is likely broken too. hmmm -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 11:11, 9 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
::It&#039;s not just the denormal range, it affects the normal range too. 2&amp;lt;sup&amp;gt;-104&amp;lt;/sup&amp;gt; is small but not denormal; the denormal range starts at 2&amp;lt;sup&amp;gt;-127&amp;lt;/sup&amp;gt;. --[[User:Pedro Oval|Pedro Oval]] 16:22, 9 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
:::I start the denormalized range a power of two early but if it&#039;s failing all the way up to -104... that&#039;s a big problem. I&#039;ll have to play with it. Multiplying by a power of two shouldn&#039;t trash the mantissa. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 20:29, 11 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
::::Maybe I misunderstood. If what you meant is that hex floating point format is unable to produce denormal numbers, then that&#039;s exactly the problem, yes. 0x1p-127 produces 0, even if the denormal range can represent numbers down to 0x1p-149. What I meant is that inputs to the function representing exponents of -104 or below failed (as these involved calculation of 0x1p-127 or below). Now some good news. The new function revised to use [[llPow]] works correctly for small exponents and seems to work correctly for the rest. Also, under Mono at least its performance is about 2.5 times that of the old (string operations are s-l-o-w). --[[User:Pedro Oval|Pedro Oval]] 06:24, 12 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
== Bug in fui ==&lt;br /&gt;
&lt;br /&gt;
Alas, iuf is not the only one with problems. For exponents of -2 or less, and mantissas in the vicinity of 0x7FFFFF, results are almost always wrong. Examples:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;fui(iuf(0x017fffdd)) = 0x01ffffee&amp;lt;/code&amp;gt; (the first one failing with mantissa &amp;gt; 0x7FFF00, exponent is -124)&lt;br /&gt;
* &amp;lt;code&amp;gt;fui(iuf(0x017fffff)) = 0x01ffffff&amp;lt;/code&amp;gt; (the last one failing with that exponent; all in the middle also fail)&lt;br /&gt;
* &amp;lt;code&amp;gt;fui(iuf(0x01ffffc5)) = 0x027fffe2&amp;lt;/code&amp;gt; (next one failing)&lt;br /&gt;
* &amp;lt;code&amp;gt;fui(iuf(0x01ffffff)) = 0x027fffff&amp;lt;/code&amp;gt; (last one with that exponent, all in the middle fail)&lt;br /&gt;
* &amp;lt;code&amp;gt;fui(iuf(0x037ffffd)) = 0x03fffffe&amp;lt;/code&amp;gt; (for this exponent the failure range is shorter - just 3 numbers)&lt;br /&gt;
* &amp;lt;code&amp;gt;fui(iuf(0x38ffffff)) = 0x38ffffff&amp;lt;/code&amp;gt; (for a few exponents there are no failures at all; this is an example)&lt;br /&gt;
* &amp;lt;code&amp;gt;fui(iuf(0x3e7fffff)) = 0x3effffff&amp;lt;/code&amp;gt; (last one failing)&lt;br /&gt;
&lt;br /&gt;
I&#039;ve manually checked some of the iuf conversions and they worked correctly with the code I posted above, so the problem is in fui. For example: &amp;lt;code&amp;gt;if (iuf(0x25fffff6) == .44408894e-15) llOwnerSay(&amp;quot;iuf ok&amp;quot;);&amp;lt;/code&amp;gt; says &amp;quot;iuf ok&amp;quot;, but fui(.44408894e-15) gives 0x267ffffb, not 0x25fffff6. --[[User:Pedro Oval|Pedro Oval]] 11:48, 8 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
:Are you doing these tests in Mono, LSO or both? -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 10:48, 9 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
::I tested the full range only in Mono, but a quick run seems to show that LSO is affected in exactly the same way. At least the range starts in the same number (0x017fffdd) and produces the same result (0x01ffffee). --[[User:Pedro Oval|Pedro Oval]] 16:31, 9 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
:It will take me some time (maybe a few weeks) to get around to this, I&#039;m very busy currently. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 11:14, 9 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
::I admit to kicking off Pedro&#039;s investigation, as I tried to use iuf and fui in Mono and found that fui (iuf (x) )  gave zero for all values of x from 1 to 3 million, at which point when I gave up :) They seem to work a lot better in LSO from my briefer tests so far. [[User:Omei Qunhua|Omei Qunhua]] 15:52, 9 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
= Try these =&lt;br /&gt;
I&#039;ve swapped out the hack pow method for the real function. I&#039;m hoping this will fix iuf.&lt;br /&gt;
&lt;br /&gt;
I&#039;ve also expanded the compressed lines so that they are easier to tinker with. I&#039;ve enlarged the supported range of &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; in the error calculation, the range supported has changed from [0.5, 4) to [0.25, 4).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
integer fui(float a)//Mono Safe, LSO Safe, Doubles Unsupported, LSLEditor Unsafe&lt;br /&gt;
{//union float to integer&lt;br /&gt;
    if((a)){//is it greater than or less than zero?&lt;br /&gt;
        integer b = (a &amp;lt; 0) &amp;lt;&amp;lt; 31;//the sign, but later this variable is reused to store the shift&lt;br /&gt;
        if((a = llFabs(a)) &amp;lt; 2.3509887016445750159374730744445e-38)//Denormalized range check &amp;amp; last stride of normalized range&lt;br /&gt;
            return b | (integer)(a / 1.4012984643248170709237295832899e-45);//the math overlaps; saves cpu time.&lt;br /&gt;
        if(a &amp;gt; 3.4028234663852885981170418348452e+38)//Round up to infinity&lt;br /&gt;
            return b | 0x7F800000;//Positive or negative infinity&lt;br /&gt;
        integer c = llFloor((llLog(a) / 0.69314718055994530941723212145818));//extremes will error towards extremes. following yuch corrects it.&lt;br /&gt;
        c -= (c &amp;gt;&amp;gt; 31) | 1;//this sets up an error towards the zero&lt;br /&gt;
        a /= llPow(2.0, c);//a should now be in the range [0.25, 4).&lt;br /&gt;
        integer d = (integer)a + (0.5 &amp;gt;= a) - (3 &amp;lt;= a);//This calculates the actual error. It does so by mapping the value of a to the error.&lt;br /&gt;
        //Specifically we take advantage of the where the normalization bit has been shifted.&lt;br /&gt;
        //[0.25, 0.5) == -2, [0.5, 1) == -1, [1,2) == 0, [2, 4) == 1 ~ note the actual values of d are off by two.&lt;br /&gt;
        llOwnerSay(llList2CSV([0x800000 == (0xF800000 &amp;amp; (integer)(a * (0x2000000 &amp;gt;&amp;gt; d))), c, d, a, (a &amp;lt; 0.25) || (a &amp;gt; 4)]));//first value tells you if you got d right or wrong.&lt;br /&gt;
        //The check works by seeing where the normalization bit has been shifted. The normalization bit gets chopped off with 0x7FFFFF.&lt;br /&gt;
        return (0x7FFFFF &amp;amp; (integer)(a * (0x2000000 &amp;gt;&amp;gt; d))) | (((c + 125 + d) &amp;lt;&amp;lt; 23 ) | b);&lt;br /&gt;
    }//the previous requires a lot of unwinding to understand it.&lt;br /&gt;
    if(a == 0)//Just because it&#039;s not greater than or less than zero doesn&#039;t mean it&#039;s non-zero.&lt;br /&gt;
        return ((string)a == (string)(-0.0)) &amp;lt;&amp;lt; 31;//for grins, detect the sign on zero. it&#039;s not pretty but it works.&lt;br /&gt;
    //Mono does not support indeterminates so I&#039;m not going to worry about it.&lt;br /&gt;
    return 0x7FFFFFFF;//NaN time! We have no way to tell NaN&#039;s apart so lets just choose one.&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
float iuf(integer a)&lt;br /&gt;
{//union integer to float&lt;br /&gt;
    if((a &amp;amp; 0x7F800000) == 0x7F800000)&lt;br /&gt;
        return (1 | (a &amp;gt;&amp;gt; 31)) * (float)llList2String([&amp;quot;NaN&amp;quot;,&amp;quot;Infinity&amp;quot;], !(a &amp;amp; 0x7FFFFF));&lt;br /&gt;
    integer b = 0xff &amp;amp; (a &amp;gt;&amp;gt; 23);&lt;br /&gt;
    return llPow(2.0, (b | !b) - 150) * (((!!b) &amp;lt;&amp;lt; 23) | ((a &amp;amp; 0x7fffff))) * (1 | (a &amp;gt;&amp;gt; 31));&lt;br /&gt;
}//will crash if the raw exponent == 0xff; reason for crash deviates from float standard; though a crash is warranted.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
::The above fails at every number from the range I tested (mantissa in the vicinity of 0x3FFFFF, exponent -2 and below). --[[User:Pedro Oval|Pedro Oval]] 06:24, 12 February 2013 (PST)&lt;br /&gt;
:::More specifically, it seems to fail for all numbers with bit 22 set (mask 0x00400000). --[[User:Pedro Oval|Pedro Oval]] 16:53, 13 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
This uses a modified error correction code. I&#039;m not sure if it will be better or worse. It has the potential to run out the high side of the stated bounds on &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; but I don&#039;t think this will be the case. We shall have to see.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
integer fui(float a)//Mono Safe, LSO Safe, Doubles Unsupported, LSLEditor Unsafe&lt;br /&gt;
{//union float to integer&lt;br /&gt;
    if((a)){//is it greater than or less than zero?&lt;br /&gt;
        integer b = (a &amp;lt; 0) &amp;lt;&amp;lt; 31;//the sign, but later this variable is reused to store the shift&lt;br /&gt;
        if((a = llFabs(a)) &amp;lt; 2.3509887016445750159374730744445e-38)//Denormalized range check &amp;amp; last stride of normalized range&lt;br /&gt;
            return b | (integer)(a / 1.4012984643248170709237295832899e-45);//the math overlaps; saves cpu time.&lt;br /&gt;
        if(a &amp;gt; 3.4028234663852885981170418348452e+38)//Round up to infinity&lt;br /&gt;
            return b | 0x7F800000;//Positive or negative infinity&lt;br /&gt;
        integer c = llFloor((llLog(a) / 0.69314718055994530941723212145818));//extremes will error towards extremes. following yuch corrects it.&lt;br /&gt;
        --c;//Make it error down. Hopefully this won&#039;t shift anyone into the [4, 8) range.&lt;br /&gt;
        a /= llPow(2.0, c);//a should now be in the range [0.5, 4), we assume no error is added.&lt;br /&gt;
        integer d = (integer)a - (3 &amp;lt;= a);//This calculates the actual error. As it turns out, the integer portion of a is {0,1,2,3} the errors in c are {-1,0,1,1}&lt;br /&gt;
        llOwnerSay(llList2CSV([0x800000 == (0xF800000 &amp;amp; (integer)(a * (0x2000000 &amp;gt;&amp;gt; d))), c, d, a]));&lt;br /&gt;
        return (0x7FFFFF &amp;amp; (integer)(a * (0x1000000 &amp;gt;&amp;gt; d))) | (((c + 126 + d) &amp;lt;&amp;lt; 23 ) | b);&lt;br /&gt;
    }//the previous requires a lot of unwinding to understand it.&lt;br /&gt;
    if(a == 0)//Just because it&#039;s not greater than or less than zero doesn&#039;t mean it&#039;s non-zero.&lt;br /&gt;
        return ((string)a == (string)(-0.0)) &amp;lt;&amp;lt; 31;//for grins, detect the sign on zero. it&#039;s not pretty but it works.&lt;br /&gt;
    //Mono does not support indeterminates so I&#039;m not going to worry about it.&lt;br /&gt;
    return 0x7FFFFFFF;//NaN time! We have no way to tell NaN&#039;s apart so lets just choose one.&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
float iuf(integer a)&lt;br /&gt;
{//union integer to float&lt;br /&gt;
    if((a &amp;amp; 0x7F800000) == 0x7F800000)&lt;br /&gt;
        return (1 | (a &amp;gt;&amp;gt; 31)) * (float)llList2String([&amp;quot;NaN&amp;quot;,&amp;quot;Infinity&amp;quot;], !(a &amp;amp; 0x7FFFFF));&lt;br /&gt;
    integer b = 0xff &amp;amp; (a &amp;gt;&amp;gt; 23);&lt;br /&gt;
    return llPow(2.0, (b | !b) - 150) * (((!!b) &amp;lt;&amp;lt; 23) | ((a &amp;amp; 0x7fffff))) * (1 | (a &amp;gt;&amp;gt; 31));&lt;br /&gt;
}//will crash if the raw exponent == 0xff; reason for crash deviates from float standard; though a crash is warranted.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
::The above passed the test in the range where version 1 failed (vicinity of 0x7fffff for mantissa and exponents up to -2). Also, fui(iuf(i))==i produces no mismatch in a random sample of 2M integers (version 1 produced 2 mismatches in a random sample of 1M). Looks promising. I&#039;m not testing it in LSO though - too slow :) --[[User:Pedro Oval|Pedro Oval]] 06:24, 12 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
:::A distributed computation over the whole range of integers except those representing NaN and Inf (I used 64 scripts in 16 sims computing 64M numbers each) has showed that the fui and iuf functions above work flawlessly for every supported integer. Those representing NaN were not tested for the obvious reason of unavoidable data loss. We have a winner. Thank you so very very much. --[[User:Pedro Oval|Pedro Oval]] 21:34, 13 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
::::This is kind of scary, I wasn&#039;t expecting this version to work. The other version was the one I was expecting to work. Sounds like there were two bugs. I&#039;ll compress it back into an optimized form. This makes me worry about Float2Hex working, since it sounds like the string-&amp;gt;float typecast doesn&#039;t like very small numbers. I wonder if there is a cap on the exponent? I shall have to test. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 11:08, 14 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
::::: I&#039;ve made some experiments now. &amp;lt;code&amp;gt;(float)&amp;quot;something&amp;quot;&amp;lt;/code&amp;gt; seems to fail under Mono whenever &amp;quot;something&amp;quot; results in a number less than &amp;lt;code&amp;gt;0x1p-126&amp;lt;/code&amp;gt;, no matter if it&#039;s hex or otherwise.&lt;br /&gt;
&lt;br /&gt;
::::: However, &amp;lt;code&amp;gt;(vector)&amp;quot;&amp;amp;lt;something,something,something&amp;gt;&amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;(rotation)&amp;quot;&amp;amp;lt;something,something,something,something&amp;gt;&amp;quot;&amp;lt;/code&amp;gt; both work fine with numbers in that range even in Mono.&lt;br /&gt;
&lt;br /&gt;
::::: Go figure... -- [[User:Pedro Oval|Pedro Oval]] ([[User talk:Pedro Oval|talk]]) 05:41, 19 September 2015 (PDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
integer fui(float a)//Mono Safe, LSO Safe, Doubles Unsupported, LSLEditor Unsafe&lt;br /&gt;
{//union float to integer&lt;br /&gt;
    if((a)){//is it greater than or less than zero?&lt;br /&gt;
        integer b = (a &amp;lt; 0) &amp;lt;&amp;lt; 31;//the sign, but later this variable is reused to store the shift&lt;br /&gt;
        if((a = llFabs(a)) &amp;lt; 2.3509887016445750159374730744445e-38)//Denormalized range check &amp;amp; last stride of normalized range&lt;br /&gt;
            return b | (integer)(a / 1.4012984643248170709237295832899e-45);//the math overlaps; saves cpu time.&lt;br /&gt;
        if(a &amp;gt; 3.4028234663852885981170418348452e+38)//Round up to infinity&lt;br /&gt;
            return b | 0x7F800000;//Positive or negative infinity&lt;br /&gt;
        integer c = ~-llFloor((llLog(a) / 0.69314718055994530941723212145818));//extremes will error towards extremes. following yuch corrects it.&lt;br /&gt;
        return (0x7FFFFF &amp;amp; (integer)(a * (0x1000000 &amp;gt;&amp;gt; b))) | (((c + 126 + (b = ((integer)a - (3 &amp;lt;= (a /= llPow(2.0, c)))))) &amp;lt;&amp;lt; 23 ) | b);&lt;br /&gt;
    }//the previous requires a lot of unwinding to understand it.&lt;br /&gt;
    if(a == 0)//Just because it&#039;s not greater than or less than zero doesn&#039;t mean it&#039;s non-zero.&lt;br /&gt;
        return ((string)a == (string)(-0.0)) &amp;lt;&amp;lt; 31;//for grins, detect the sign on zero. it&#039;s not pretty but it works.&lt;br /&gt;
    //Mono does not support indeterminates so I&#039;m not going to worry about it.&lt;br /&gt;
    return 0x7FFFFFFF;//NaN time! We have no way to tell NaN&#039;s apart so lets just choose one.&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
float iuf(integer a)&lt;br /&gt;
{//union integer to float&lt;br /&gt;
    if((a &amp;amp; 0x7F800000) == 0x7F800000)&lt;br /&gt;
        return (1 | (a &amp;gt;&amp;gt; 31)) * (float)llList2String([&amp;quot;NaN&amp;quot;,&amp;quot;Infinity&amp;quot;], !(a &amp;amp; 0x7FFFFF));&lt;br /&gt;
    return llPow(2.0, (a | !a) - 150) * (((!!(a = (0xff &amp;amp; (a &amp;gt;&amp;gt; 23)))) &amp;lt;&amp;lt; 23) | ((a &amp;amp; 0x7fffff))) * (1 | (a &amp;gt;&amp;gt; 31));&lt;br /&gt;
}//will crash if the raw exponent == 0xff; reason for crash deviates from float standard; though a crash is warranted.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Lots to comment on, and MediaWiki&#039;s standard for follow-up responses is quite inconvenient for this purpose. I hope you don&#039;t mind if I post this reply without indentation.&lt;br /&gt;
&lt;br /&gt;
First, I&#039;m pretty sure that the failure of the previous function must be due to a bug somewhere, not to the algorithm, given that the failure pattern seems very clear and consistent. I haven&#039;t analyzed it so I can&#039;t tell more for now.&lt;br /&gt;
&lt;br /&gt;
Second, your sentence &amp;quot;I wonder if there is a cap on the exponent?&amp;quot; suggests to me that you have missed my last reply in the [[#Bug in iuf|iuf bug discussion]].&lt;br /&gt;
&lt;br /&gt;
Third, the &amp;quot;compressed&amp;quot; versions work, though I haven&#039;t tested the whole range, just a random sample of 10M integers.&lt;br /&gt;
&lt;br /&gt;
Fourth, the NaN test is flawed. if((a)) is equivalent to if(!(a==0)) and is true for NaNs.&lt;br /&gt;
&lt;br /&gt;
Fifth, the usual NaN returned by gcc is 0x7FC00000, so I suggest to use that for possible interoperability. It has the &amp;quot;quiet&amp;quot; bit set and nothing else.&lt;br /&gt;
&lt;br /&gt;
Sixth, I see quite some room for memory optimizations in Mono for both functions, while minimally affecting performance if at all. Changes include:&lt;br /&gt;
&lt;br /&gt;
* Changing division to multiplication where possible.&lt;br /&gt;
* Changing &amp;lt;= to &amp;lt; and &amp;gt;= to &amp;gt; where possible. a &amp;lt;= b is equivalent to !(a &amp;gt; b) both in size and in behavior even with NaNs (sad, I know).&lt;br /&gt;
* Changing subtraction to addition of opposite (a-b to a+-b).&lt;br /&gt;
* Changing -constant to its hex representation.&lt;br /&gt;
* Changing 2.0 to 2&lt;br /&gt;
* Changing &amp;lt;&amp;lt; constant to * constant (&amp;gt;&amp;gt; and / take the same bytes so no gain there, plus there are sign issues).&lt;br /&gt;
* Changing (a &amp;amp; constant) == constant to !(~a &amp;amp; constant).&lt;br /&gt;
* Using localint^localint instead of 0.&lt;br /&gt;
* Change the logic of Infinity and NaN in iuf, to get rid of the list, using that (float)&amp;quot;Inf&amp;quot; yields infinity and that parsing stops at the first invalid character without invalidating the previous results.&lt;br /&gt;
* Changing (string)-0.0 to &amp;quot;-0.000000&amp;quot; (this one is the only one I don&#039;t have reliable experimental results to back, but I believe it will save memory; it almost surely will perform better by not needing to build that string at run time).&lt;br /&gt;
&lt;br /&gt;
Here are Mono-memory-optimized versions taking into account all of these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
integer fui(float a)//Mono Safe, ????LSO Safe???? (untested), Doubles Unsupported, LSLEditor Unsafe&lt;br /&gt;
{//union float to integer&lt;br /&gt;
    if(a){//is it nonzero?&lt;br /&gt;
        integer b = (a &amp;lt; 0) * 0x80000000;//the sign, but later this variable is reused to store the shift&lt;br /&gt;
        if((a = llFabs(a)) &amp;lt; 2.3509887016445750159374730744445e-38)//Denormalized range check &amp;amp; last stride of normalized range&lt;br /&gt;
            return b | (integer)(a / 1.4012984643248170709237295832899e-45);//the math overlaps; saves cpu time.&lt;br /&gt;
        if(a &amp;gt; 3.4028234663852885981170418348452e+38)//Round up to infinity&lt;br /&gt;
            return b | 0x7F800000;//Positive or negative infinity&lt;br /&gt;
        if(a &amp;gt; 1e-45)//It should at this point, except if it&#039;s NaN&lt;br /&gt;
        {&lt;br /&gt;
            integer c = ~-llFloor((llLog(a) / 0.69314718055994530941723212145818));//extremes will error towards extremes. following yuch corrects it.&lt;br /&gt;
            return (0x7FFFFF &amp;amp; (integer)(a * (0x1000000 &amp;gt;&amp;gt; b))) | (((c + 126 + (b = ((integer)a + -(3 &amp;lt;= (a *= llPow(2, -c)))))) * 0x800000 ) | b);&lt;br /&gt;
        }//the previous requires a lot of unwinding to understand it.&lt;br /&gt;
        return 0x7FC00000;//NaN time! We have no way to tell NaN&#039;s apart so lets just choose one.&lt;br /&gt;
    }&lt;br /&gt;
    return ((string)a == &amp;quot;-0.000000&amp;quot;) * 0x80000000;//for grins, detect the sign on zero. it&#039;s not pretty but it works.&lt;br /&gt;
}//Mono does not support indeterminates so I&#039;m not going to worry about it.&lt;br /&gt;
&lt;br /&gt;
float iuf(integer a)&lt;br /&gt;
{//union integer to float&lt;br /&gt;
    if(!(~a &amp;amp; 0x7F800000))&lt;br /&gt;
        return (float)llGetSubString(&amp;quot;-nan-inf&amp;quot;, 4 * !(a &amp;amp; 0x7FFFFF) + (a &amp;gt; (a^a)), 7);&lt;br /&gt;
    return llPow(2, (a | !a) + 0xffffff6a) * (((!!(a = (0xff &amp;amp; (a &amp;gt;&amp;gt; 23)))) * 0x800000) | ((a &amp;amp; 0x7fffff))) * (1 | (a &amp;gt;&amp;gt; 31));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Further possible optimizations include replacing other divisions with multiplications where possible (llLog(a) / 0.693... might be a candidate, but it&#039;s at the core of the algorithm so I didn&#039;t dare) and replacing &amp;lt;= with &amp;lt; in the (3 &amp;lt;= ...) if possible. If it&#039;s equivalent to (2 &amp;lt; ...) then the latter is preferable. Also, although I&#039;ve not touched them, source code wise, the floats used have an unnecessary precision; using respectively 2.3509887e-38, 1e-45, 3.4028235e+38, and 0.6931472, the results are the same. You can check that doing: float f1 = 2.3509887016445750159374730744445e-38; float f2 = 2.3509887e-38; if (f1 == f2) llOwnerSay(&amp;quot;yes&amp;quot;); outputs yes, and similarly for the rest. Doubles are not supported after all.&lt;br /&gt;
&lt;br /&gt;
For the sake of verifiability, here&#039;s my simpler test program (not the distributed one, although it&#039;s along the same lines):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
string tohex(integer i)&lt;br /&gt;
{&lt;br /&gt;
    string hex = &amp;quot;0123456789ABCDEF&amp;quot;;&lt;br /&gt;
    string result;&lt;br /&gt;
    integer iter = 9;&lt;br /&gt;
    while (--iter)&lt;br /&gt;
    {&lt;br /&gt;
        result = llGetSubString(hex, i &amp;amp; 0xF, i &amp;amp; 0xF) + result;&lt;br /&gt;
        i = i &amp;gt;&amp;gt; 4;&lt;br /&gt;
    }&lt;br /&gt;
    return result;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        if (fui(iuf(0x7F800000)) ^ 0x7F800000) llOwnerSay(&amp;quot;Fail at +inf&amp;quot;);&lt;br /&gt;
        if (fui(iuf(0xFF800000)) ^ 0xFF800000) llOwnerSay(&amp;quot;Fail at -inf&amp;quot;);&lt;br /&gt;
        if (fui(iuf(0x7FC00000)) ^ 0x7FC00000) llOwnerSay(&amp;quot;Fail at NaN1&amp;quot;);&lt;br /&gt;
        if (fui(iuf(0xFFC00000)) ^ 0x7FC00000) llOwnerSay(&amp;quot;Fail at NaN2&amp;quot;);&lt;br /&gt;
        if (fui(iuf(0x7FC0FFFF)) ^ 0x7FC00000) llOwnerSay(&amp;quot;Fail at NaN3&amp;quot;);&lt;br /&gt;
        if (fui(iuf(0xFFC00001)) ^ 0x7FC00000) llOwnerSay(&amp;quot;Fail at NaN4&amp;quot;);&lt;br /&gt;
        if (fui(iuf(0x00000000)) ^ 0x00000000) llOwnerSay(&amp;quot;Fail at 0.0&amp;quot;);&lt;br /&gt;
        if (fui(iuf(0x80000000)) ^ 0x80000000) llOwnerSay(&amp;quot;Fail at -0.0&amp;quot;);&lt;br /&gt;
        if (fui(iuf(0x00000001)) ^ 0x00000001) llOwnerSay(&amp;quot;Fail at 1e-45&amp;quot;);&lt;br /&gt;
        if (fui(iuf(0x80000001)) ^ 0x80000001) llOwnerSay(&amp;quot;Fail at -1e-45&amp;quot;);&lt;br /&gt;
        if (fui(iuf(0xFF7FFFFF)) ^ 0xFF7FFFFF) llOwnerSay(&amp;quot;Fail at ~ -1e38&amp;quot;);&lt;br /&gt;
        integer a;&lt;br /&gt;
        integer iter;&lt;br /&gt;
        while (++iter)&lt;br /&gt;
        {&lt;br /&gt;
            integer rand = (integer)llFrand(65536) + 65536 * (integer)llFrand(65536);&lt;br /&gt;
            if (!(iter &amp;amp; 0xFFFF)) llSetText((string)iter, &amp;lt;1,1,1&amp;gt;, 1);&lt;br /&gt;
&lt;br /&gt;
            if (fui(iuf(rand)) != rand) // we let it run for NaNs too to detect crashes&lt;br /&gt;
            {&lt;br /&gt;
                if (~rand &amp;amp; 0x7F800000)&lt;br /&gt;
                {&lt;br /&gt;
                    llSetText(&amp;quot;Fail at rand = 0x&amp;quot; + tohex(rand) + &amp;quot;, fui(iuf(rand)) = 0x&amp;quot; + tohex(fui(iuf(rand))), &amp;lt;1,1,1&amp;gt;,1);&lt;br /&gt;
                    return;&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        llSetText(&amp;quot;Done&amp;quot;, &amp;lt;1,1,1&amp;gt;, 1);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
I simply let it run while desired.&lt;br /&gt;
&lt;br /&gt;
--[[User:Pedro Oval|Pedro Oval]] 11:02, 15 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
:I hadn&#039;t seen your previous comment, thank you for pointing it out. I&#039;ll try to patch Float2Hex so it doesn&#039;t use exponents less than -127 (it use to work on Mono ~_~).&lt;br /&gt;
&lt;br /&gt;
:You are correct, the extra precision is unnecessary for single precision. I use these values because Float2Hex uses them, and I&#039;ve written versions of Float2Hex that support higher precisions. I wrote both originally in ESL (LSL fed through a C Pre-processor) with extensive use of macros.&lt;br /&gt;
&lt;br /&gt;
:I tend to optimize for LSO bytecode and stack size (I know it&#039;s insane but old habits die hard). Which is why I wasn&#039;t using llPow. I&#039;m not surprised there is a bytecode savings between 2 and 2.0 for Mono but is it really faster? I would have though the compiler would have put in the implicit typecast there... unless LL got smart... hmmm. Anyway we are well beyond optimizing for LSO.&lt;br /&gt;
&lt;br /&gt;
:You could try flipping the divide in the log2 calculation, I&#039;m not sure if the error recovery is good enough. My recollection from my initial testing was that using a multiply instead of the divide widened the range of the errors.&lt;br /&gt;
&lt;br /&gt;
:I never wanted to committing to inlining &amp;quot;-0.000000&amp;quot; in fear they might change the typecast on me. We won that fight a few years ago so it should be ok.&lt;br /&gt;
&lt;br /&gt;
:Quick question, what does the following do? Trying to figure out how screwed I am. I am hoping to avoid having Float2Hex revert to base 10 for |x| &amp;lt; 0x1p-127 (I don&#039;t even know of a good way to do that x_x).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;default {&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llOwnerSay((string)(0.0 != (float)&amp;quot;0x0.4p-127&amp;quot;));&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Unless testing proves otherwise, we don&#039;t want to swap in a multiplication for a shift, at the CPU level shift should be faster. Swapping a subtract out for an add-negation similarly won&#039;t give you much as negation would be an extra instruction (unless the negation is being done on a constant than it&#039;s no extra).&lt;br /&gt;
&lt;br /&gt;
:1e-45 makes me uneasy. I know it works but it just looks wrong to me. I am cool with excessive precision.&lt;br /&gt;
&lt;br /&gt;
:I&#039;ve made a few changes. I couldn&#039;t help myself. I used the dreaded negative indexing on llGetSubString, &#039;&#039;with wraparound&#039;&#039;. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 22:16, 16 February 2013 (PST)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
integer fui(float a)//Mono Safe, LSO Safe, Doubles Unsupported, LSLEditor Unsafe&lt;br /&gt;
{//union float to integer&lt;br /&gt;
    if(a){//is it nonzero?&lt;br /&gt;
        integer b = (a &amp;lt; 0) * 0x80000000;//the sign&lt;br /&gt;
        if((a = llFabs(a)) &amp;lt; 2.3509887016445750159374730744445e-38)//Denormalized range check &amp;amp; last stride of normalized range&lt;br /&gt;
            return b | (integer)(a / 1.4012984643248170709237295832899e-45);//the math overlaps; saves cpu time.&lt;br /&gt;
        if(a &amp;gt; 3.4028234663852885981170418348452e+38)//Round up to infinity&lt;br /&gt;
            return b | 0x7F800000;//Positive or negative infinity&lt;br /&gt;
        if(a &amp;gt; 1.4012984643248170709237295832899e-45){//It should at this point, except if it&#039;s NaN&lt;br /&gt;
            integer c = ~-llFloor(llLog(a) * 1.4426950408889634073599246810019);//extremes will error towards extremes. following yuch corrects it&lt;br /&gt;
            return b | (0x7FFFFF &amp;amp; (integer)(a * (0x1000000 &amp;gt;&amp;gt; c))) | ((126 + (c = ((integer)a - (3 &amp;lt;= (a *= llPow(2, -c))))) + c) * 0x800000);&lt;br /&gt;
        }//the previous requires a lot of unwinding to understand it.&lt;br /&gt;
        return 0x7FC00000;//NaN time! We have no way to tell NaN&#039;s apart so lets just choose one.&lt;br /&gt;
    }//Mono does not support indeterminates so I&#039;m not going to worry about them.&lt;br /&gt;
    return ((string)a == &amp;quot;-0.000000&amp;quot;) * 0x80000000;//for grins, detect the sign on zero. it&#039;s not pretty but it works.&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
float iuf(integer a)&lt;br /&gt;
{//union integer to float&lt;br /&gt;
    if(!(0x7F800000 &amp;amp; ~a))&lt;br /&gt;
        return (float)llGetSubString(&amp;quot;-infnan&amp;quot;, 3 * ~!(a &amp;amp; 0x7FFFFF), ~a &amp;gt;&amp;gt; 31);&lt;br /&gt;
    return llPow(2, (a | !a) + 0xffffff6a) * (((!!(a = (0xff &amp;amp; (a &amp;gt;&amp;gt; 23)))) * 0x800000) | (a &amp;amp; 0x7fffff)) * (1 | (a &amp;gt;&amp;gt; 31));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::The version with multiply turned out to work fine in a sample of ~600M random numbers, so yay! On the bad news side, the test program you asked me to run returns 0. As I said, 1p-127 returns 0 already, so no surprise there, but I tested this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay((string)(0.0 != (float)&amp;quot;0x0.ffffffp-126&amp;quot;));&lt;br /&gt;
        llOwnerSay((string)(0.0 != (float)&amp;quot;0x1.0p-126&amp;quot;));&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
::and got 0 and 1. So I&#039;m afraid hex notation refuses to produce any denormal at all. &amp;lt;strike&amp;gt;A strategy you can maybe use for denormals is to treat them as a special case multiplying them by a power of two, so they come into a tractable range. But I haven&#039;t checked the source so I may be off here.&amp;lt;/strike&amp;gt; (Oops, got your point now - there may be a way using part of the strategy I mention, I&#039;ll think about something)&lt;br /&gt;
&lt;br /&gt;
::As for optimizations, I like your &amp;quot;risky&amp;quot; rewriting of llGetSubString, and of course it works. I know mults are slower than shifts (if that&#039;s what the code is compiled to in the end, which is questionable), but the difference, just maybe ten cycles or so, is really unnoticeable when there&#039;s a whole burden of task switching and other stuff going on. For that reason I tend to always optimize for memory. In the above case, it will matter little if the function takes 30000 or 30010 cycles to execute, just as an example to make my point (I&#039;m sure the actual numbers will be different). Same with minus sign: the extra CPU burden will be insignificant (1 cycle probably). I&#039;ve tried to test these differences but I never got conclusive results because noise level exceeds signal level by far, which just proves how insignificant the difference is. I tend to run out of space in scripts so I mostly optimize for memory. While I get to 60K+ code size often, I have yet to run into an application where shoving cycles that way gains anything noticeable. Also, I started to test this for Omei because she intended to use it in a memory-tight application. The space savings can make a difference.&lt;br /&gt;
&lt;br /&gt;
::The int-to-float implicit conversion seems to add an explicit cast, as an int constant is 6 bytes, a float constant is 10, and an integer implicitly or explicitly cast to float takes 7. By the way, -~-x is a saving vs. 1-x and vs. 1+-x (1 byte per unary sign vs. 6 bytes the integer constant, 8 the subtraction and 4 the addition). I have Mono size measurements here: [[User:Pedro Oval/Mono code memory usage]].&lt;br /&gt;
&lt;br /&gt;
::As for the 1e-45, OK, though I like it because it also reflects the loss of precision that happens in denormals. But it&#039;s my opinion that using the whole expansion in the comparison to detect a NaN is overkill, as any number between 1e-45 and 2.35e-38 will do. For example, 1e-40 is equally valid and doesn&#039;t clobber the source so much. --[[User:Pedro Oval|Pedro Oval]] 19:36, 17 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
::Alas, it&#039;s worse than I thought. 1.17e-38 (a denormal) works fine, but (float)&amp;quot;1.17e-38&amp;quot; returns 0. Not sure when did glibc stop supporting denormals. --[[User:Pedro Oval|Pedro Oval]] 19:59, 17 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
:::I&#039;ve put -~- back. I can&#039;t thank you enough for all your testing. I totally agree, optimizing for size is the main concern. I didn&#039;t remember this about logarithms that log&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;b * log&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt;a = 1. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 21:38, 17 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
:::Crap. Both Float2Sci and Float2Hex are screwed. Without having access to the source for the Mono compiler we can&#039;t be sure it&#039;s glibc or Mono, though we can confirm it&#039;s glibc that&#039;s bugged by checking how it works with LSO. I may just have to manifest at an upcoming [[Simulator_User_Group|Simulator]]/[[Server_Beta_User_Group|Server_Beta]] User Group meeting and complain. should open up a ticket on jira first. hmmm. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::Duh, good point. It&#039;s a Mono-only quirk. (float)&amp;quot;0x1p-127&amp;quot;, (float)&amp;quot;0x1p-149&amp;quot;, and (float)&amp;quot;1e-45&amp;quot; are all nonzero in LSO, and the latter two are equal to 1e-45 as expected. About the latest change, I fail to see the gain in moving the sign of c to the &amp;lt;code&amp;gt;-~-llFloor&amp;lt;/code&amp;gt; line, as that forces a subtraction later which eats 4 extra bytes. Could it not remain as &amp;lt;code&amp;gt;integer c = ~-llFloor...&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;...llPow(2, -c))))) + c)&amp;lt;/code&amp;gt;? --[[User:Pedro Oval|Pedro Oval]] 20:23, 18 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
:::::Of course it can but why should it make a difference as we have just moved the negation further down. Am I missing something? Please tell me that subtraction isn&#039;t more expensive than addition. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 21:47, 18 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
::::::Sorry to bring bad news but yes: addition of two local integers takes 4 bytes, as does multiplication. But subtraction takes 8, as do division, mod and shift. &amp;quot;!&amp;quot; takes 3 bytes, while &amp;quot;~&amp;quot; and &amp;quot;-&amp;quot; take 1 each. Take a look at the table I linked to. You&#039;ll want to cry. As for the several variants you enumerate below, regrettably, float to integer cast takes 5 bytes, which is more than leaving it as &amp;lt;= instead of &amp;lt; (3 extra bytes). I think function calls need at least as many bytes as their name, so I wouldn&#039;t go that route. Not 100% sure there though. Converting x-y to x+-y saves 3 bytes. --[[User:Pedro Oval|Pedro Oval]] 14:31, 19 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
:Oh yeah, ((integer)x - (3 &amp;lt;= x)) is equivalent to...&lt;br /&gt;
:* (integer)x - (2 &amp;lt; (integer)(x))&lt;br /&gt;
:* (integer)x - (((integer)(x)) == 3)&lt;br /&gt;
:* (integer)x + (((integer)(x)) / -3)&lt;br /&gt;
:* (integer)x - !(3 &amp;amp; ~(integer)(x))&lt;br /&gt;
:* (integer)x - (2 &amp;lt; llFloor(x))&lt;br /&gt;
:* (integer)x - ((llFloor(x)) == 3)&lt;br /&gt;
:* (integer)x + ((llFloor(x)) / -3)&lt;br /&gt;
:* (integer)x - !(3 &amp;amp; ~llFloor(x))&lt;br /&gt;
: the value of x will always be in the range [0.5, 4). Truncating or rounding it down to an integer result in it being in the range [0, 3], we want to further truncate this range to [0, 2]. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 22:33, 18 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
:* (integer)x + (integer)(x * -0.3333333432674407958984375)&lt;br /&gt;
:* (integer)x - (2.9999997615814208984375 &amp;lt; x))&lt;br /&gt;
&lt;br /&gt;
:Another reason for the excessive precision, I test a lot of code in LSLEditor, which uses doubles. If I want things to work I have to keep my constants in double precision land. I calculate most of them with the windows calculator and then just copy and paste. That way when I paste them back into the windows calculator I can work the math backwards and figure out where the constants came from. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 23:43, 18 February 2013 (PST)&lt;br /&gt;
&lt;br /&gt;
== too many (, or not enough ) ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
return (0x3FF &amp;amp; (integer)(a * (0x800 &amp;gt;&amp;gt; b))) | (((c + (b = ((integer)a - (3 &amp;lt;= (a *= (0.0000152587890625 * (0x40000000 &amp;gt;&amp;gt; c)))))) &amp;lt;&amp;lt; 10 ) | b);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
count(&amp;quot;(&amp;quot;) != count(&amp;quot;)&amp;quot;) [[User:Cron Stardust|Cron Stardust]] 07:04, 27 June 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
:I think that&#039;s a left over from a last minute refactoring. Fixed. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 20:36, 27 June 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
:: Thanks! :D [[User:Cron Stardust|Cron Stardust]] 20:55, 27 June 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Indeterminates ==&lt;br /&gt;
&lt;br /&gt;
There&#039;s one more value that can be encoded and read back: indeterminate. Indeterminate values have a representation of FFC00000, see http://babbage.cs.qc.edu/courses/cs341/IEEE-754references.html#kevin_chart. They can be read through llList2CSV and they show as -nan. &amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        float a=(float)&amp;quot;nan&amp;quot;;&lt;br /&gt;
        llOwnerSay(llList2CSV([&amp;quot;(float)\&amp;quot;nan\&amp;quot;&amp;quot;, a]));&lt;br /&gt;
        a=-a;&lt;br /&gt;
        llOwnerSay(llList2CSV([&amp;quot;-a&amp;quot;, a]));&lt;br /&gt;
        a=(float)&amp;quot;inf&amp;quot;*0;&lt;br /&gt;
        llOwnerSay(llList2CSV([&amp;quot;inf*0&amp;quot;,a]));&lt;br /&gt;
        a=llAcos(2);&lt;br /&gt;
        llOwnerSay(llList2CSV([&amp;quot;acos(2)&amp;quot;,a]));&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
/*outputs:&lt;br /&gt;
[08:05:05] Object: (float)&amp;quot;nan&amp;quot;, nan&lt;br /&gt;
[08:05:05] Object: -a, -nan&lt;br /&gt;
[08:05:05] Object: inf*0, -nan&lt;br /&gt;
[08:05:05] Object: acos(2), nan&lt;br /&gt;
*/&amp;lt;/source&amp;gt; (float)&amp;quot;-nan&amp;quot; does not work :( --[[User:Sei Lisa|Sei Lisa]] ([[User talk:Sei Lisa|talk]]) 08:06, 6 September 2015 (PDT)&lt;br /&gt;
&lt;br /&gt;
:I think I knew (float)&amp;quot;-nan&amp;quot; was borked, can&#039;t really do anything about it. I guess I&#039;ll multiple +/-inf by zero or one for the -nan generation. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 17:05, 6 September 2015 (PDT)&lt;br /&gt;
&lt;br /&gt;
::It should be better now. Haven&#039;t compiled it. Probably should. No time now. Half-precision won&#039;t work right, it needs some TLC. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 17:45, 6 September 2015 (PDT)&lt;br /&gt;
&lt;br /&gt;
:::Thanks a lot! fui is working perfectly, but iuf can&#039;t produce nan, only -nan. If it helps, I&#039;ve found that while (float)&amp;quot;-nan&amp;quot; doesn&#039;t work, -(float)&amp;quot;nan&amp;quot; and -1*(float)&amp;quot;nan&amp;quot; do.--[[User:Sei Lisa|Sei Lisa]] ([[User talk:Sei Lisa|talk]]) 18:34, 6 September 2015 (PDT)&lt;br /&gt;
:::Correction. (-1)*(float)&amp;quot;nan&amp;quot; doesn&#039;t produce -nan. The parentheses were important.--[[User:Sei Lisa|Sei Lisa]] ([[User talk:Sei Lisa|talk]]) 08:21, 9 September 2015 (PDT)&lt;br /&gt;
&lt;br /&gt;
::::That makes some perverse sense. I&#039;ll log in sometime this weekend and figure out a way to do this (hopefully without using a branch). -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 15:26, 12 September 2015 (PDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== FUI2HexFloat ==&lt;br /&gt;
This fuction can t be compiled .&lt;br /&gt;
Error at the line if(e ^ 127)&lt;br /&gt;
e is a variable declared later &lt;br /&gt;
&lt;br /&gt;
[[User:Miranda Umino|Miranda Umino]] ([[User talk:Miranda Umino|talk]]) 11:28, 14 September 2015 (PDT)&lt;br /&gt;
&lt;br /&gt;
:it should compile now but it needs testing. --&#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 13:39, 14 September 2015 (PDT)&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=GIMP_Layers_to_SL_Animated_Texture&amp;diff=1197127</id>
		<title>GIMP Layers to SL Animated Texture</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=GIMP_Layers_to_SL_Animated_Texture&amp;diff=1197127"/>
		<updated>2015-08-05T21:24:29Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: Update to version 2.0.2&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a GIMP script (written in Script-Fu, the Scheme-based scripting language that GIMP uses) that takes the layers of an image representing an animation, and converts them into a texture suitable for use with &#039;&#039;&#039;[[llSetTextureAnim]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Copy and paste the script below into a simple text editor of your choice (Notepad is probably the best choice for Windows systems). Save it into your scripts folder with the extension .scm - the suggested name is &amp;quot;layers-to-sl-animation.scm&amp;quot;. The scripts folder can be found by going to &#039;&#039;Preferences &amp;gt; Folders &amp;gt; Scripts&#039;&#039;. After it&#039;s in the &#039;&#039;Scripts&#039;&#039; folder, do a refresh by selecting &#039;&#039;Filters &amp;gt; Script-Fu &amp;gt; Refresh Scripts&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
First, create or load an animation with one layer per frame (the first frame is the bottom layer). An existing GIF animation will work for this purpose, or you can create your own, or import one if you have enough memory. Version 1.0 of this script required to use the Unoptimize filter first in some cases; as of version 2.0, that functionality is already built in.&lt;br /&gt;
&lt;br /&gt;
Next, ensure that it has the correct size and number of frames desired. It&#039;s preferable to have a plan at this point of what the final resolution will be, and how many horizontal and vertical frames the final image will have. If you are not going to use all the frames in your final image (for example, you have 5 frames and decide to do a 3x2 image), you still need to fill the holes. Create empty layers or duplicate existing ones until completing the final frame count. If you need to rescale the image at this point and the image is indexed, it&#039;s better if you convert it to RGB mode first.&lt;br /&gt;
&lt;br /&gt;
Now invoke the script. It is invoked using &#039;&#039;Script-fu &amp;gt; SecondLife &amp;gt; Frames to texture...&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A window will appear, asking the number of horizontal and vertical frames of the final image. As noted above, that number must match the number of frames in your layers, or the script will show an error instead. It also asks whether you want to generate an animation script in a message window, and the frame rate to use for that script. Click OK and you will get a new image window consisting of the original frames arranged according to the specified values, suitable for use in SL. Now you can save the file and upload it to SL. If you had the script generation option checked, you can select the code from the window that appears, copy it, and paste it as a LSL script replacing the contents.&lt;br /&gt;
&lt;br /&gt;
== The script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;scheme&amp;quot;&amp;gt;&lt;br /&gt;
; Layers to SL Texture Animation, version 2.0.2&lt;br /&gt;
;&lt;br /&gt;
; Written by Pedro Oval, 2010-12-04.&lt;br /&gt;
; Donated to the public domain.&lt;br /&gt;
; Thanks to Digital Dharma for the suggestions.&lt;br /&gt;
&lt;br /&gt;
(define (script-fu-layers-to-sl-anim curimg curdrawable xframes yframes showscript face fps)&lt;br /&gt;
 (let ()&lt;br /&gt;
&lt;br /&gt;
  ; Local function: check if a string contains a substring&lt;br /&gt;
  (define (contains-ci str substr)&lt;br /&gt;
    (define i 0)&lt;br /&gt;
    (define lensub (string-length substr))&lt;br /&gt;
    (define imax (- (string-length str) lensub))&lt;br /&gt;
    (if (negative? imax)&lt;br /&gt;
      #f&lt;br /&gt;
      (begin&lt;br /&gt;
        (define found #f)&lt;br /&gt;
        (while (and (not found) (&amp;lt;= i imax))&lt;br /&gt;
          ; We make a case-insensitive comparison.&lt;br /&gt;
          (if (string-ci=? (substring str i (+ i lensub)) substr)&lt;br /&gt;
            (set! found #t)&lt;br /&gt;
            (set! i (+ i 1))))&lt;br /&gt;
        found)))&lt;br /&gt;
&lt;br /&gt;
  ; Read the layer IDs and the total number of layers from the original image.&lt;br /&gt;
  (define layerset (gimp-image-get-layers curimg))&lt;br /&gt;
  (define numframes (car layerset))&lt;br /&gt;
  (set! layerset (cadr layerset))&lt;br /&gt;
&lt;br /&gt;
  ; The frame size X and Y is the size of the original image.&lt;br /&gt;
  (define framesizex (car (gimp-image-width curimg)))&lt;br /&gt;
  (define framesizey (car (gimp-image-height curimg)))&lt;br /&gt;
&lt;br /&gt;
  ; Get the image type; indexed images need special treatment.&lt;br /&gt;
  (define imgtype (car (gimp-image-base-type curimg)))&lt;br /&gt;
&lt;br /&gt;
  ; Check if the given number of horizontal x vertical frames matches&lt;br /&gt;
  ; the number of layers in the original image. If yes, proceed; if not,&lt;br /&gt;
  ; show an error message.&lt;br /&gt;
  (if (= numframes (* xframes yframes))&lt;br /&gt;
    (begin&lt;br /&gt;
      ; New image&lt;br /&gt;
      (define img (car (gimp-image-new (* framesizex xframes) (* framesizey yframes) imgtype)))&lt;br /&gt;
      ; We create a new image, so we disable undo for it; to &amp;quot;undo&amp;quot;&lt;br /&gt;
      ; the script, just close the new image.&lt;br /&gt;
      (gimp-image-undo-disable img)&lt;br /&gt;
&lt;br /&gt;
      (if (= imgtype INDEXED)&lt;br /&gt;
        (begin&lt;br /&gt;
          ; Indexed images need the palette to be copied to the new image.&lt;br /&gt;
          (define palette (gimp-image-get-colormap curimg))&lt;br /&gt;
          (gimp-image-set-colormap img (car palette) (cadr palette))))&lt;br /&gt;
&lt;br /&gt;
      ; Initialize previous layer info to 0, as there&#039;s no previous layer yet.&lt;br /&gt;
      ; On the next iteration it will hold a list with:&lt;br /&gt;
      ;  layer ID, offset X, offset Y.&lt;br /&gt;
      (define prevlayerinfo 0)&lt;br /&gt;
&lt;br /&gt;
      ; Loop betwen 0 and numframes - 1.&lt;br /&gt;
      (define frame 0)&lt;br /&gt;
      (while (&amp;lt; frame numframes)&lt;br /&gt;
        ; For each layer/frame:&lt;br /&gt;
        (begin&lt;br /&gt;
&lt;br /&gt;
          ; Show progress as the current frame relative to the number of frames.&lt;br /&gt;
          (gimp-progress-update (/ frame numframes))&lt;br /&gt;
&lt;br /&gt;
          ; Read the individual layer ID, starting from the bottom.&lt;br /&gt;
          (define oldlayer (vector-ref layerset (- numframes frame 1)))&lt;br /&gt;
&lt;br /&gt;
          ; Create new layer as a copy of this one and add it to the image.&lt;br /&gt;
          (define newlayer (car (gimp-layer-new-from-drawable oldlayer img)))&lt;br /&gt;
          (gimp-image-add-layer img newlayer -1)&lt;br /&gt;
&lt;br /&gt;
          ; Add alpha if the layer doesn&#039;t have it.&lt;br /&gt;
          (if (= (car (gimp-drawable-has-alpha newlayer)) FALSE)&lt;br /&gt;
            (gimp-layer-add-alpha newlayer))&lt;br /&gt;
&lt;br /&gt;
          ; Calculate the offsets relative to the destination rectangle,&lt;br /&gt;
          ; and the crop size.&lt;br /&gt;
          (define offsets (gimp-drawable-offsets oldlayer))&lt;br /&gt;
          (define newsizex (car (gimp-drawable-width oldlayer)))&lt;br /&gt;
          (define newsizey (car (gimp-drawable-height oldlayer)))&lt;br /&gt;
          (define offsetx (car offsets))&lt;br /&gt;
          (define offsety (cadr offsets))&lt;br /&gt;
          (if (&amp;lt; offsetx 0)&lt;br /&gt;
            (begin&lt;br /&gt;
              (set! newsizex (+ newsizex offsetx))&lt;br /&gt;
              (set! offsetx 0)))&lt;br /&gt;
          (if (&amp;lt; offsety 0)&lt;br /&gt;
            (begin&lt;br /&gt;
              (set! newsizey (+ newsizey offsety))&lt;br /&gt;
              (set! offsety 0)))&lt;br /&gt;
          (if (&amp;gt; (+ offsetx newsizex) framesizex)&lt;br /&gt;
            (set! newsizex (- framesizex offsetx)))&lt;br /&gt;
          (if (&amp;gt; (+ offsety newsizey) framesizey)&lt;br /&gt;
            (set! newsizey (- framesizey offsety)))&lt;br /&gt;
&lt;br /&gt;
          ; Calculate frame rectangle&#039;s top left position.&lt;br /&gt;
          (define framey (truncate (/ frame xframes)))&lt;br /&gt;
          (define framex (- frame (* framey xframes)))&lt;br /&gt;
          (set! framex (* framex framesizex))&lt;br /&gt;
          (set! framey (* framey framesizey))&lt;br /&gt;
&lt;br /&gt;
          ; Crop the layer if necessary so that it fits its&lt;br /&gt;
          ; rectangle, and move it to its final position.&lt;br /&gt;
          (gimp-layer-resize newlayer&lt;br /&gt;
                             newsizex&lt;br /&gt;
                             newsizey&lt;br /&gt;
                             (- (car offsets) offsetx)&lt;br /&gt;
                             (- (cadr offsets) offsety))&lt;br /&gt;
          (gimp-layer-set-offsets newlayer (+ framex offsetx) (+ framey offsety))&lt;br /&gt;
&lt;br /&gt;
          ; Force it visible.&lt;br /&gt;
          (gimp-drawable-set-visible newlayer TRUE)&lt;br /&gt;
&lt;br /&gt;
          ; Check for (combine) mode. Note: It just works&lt;br /&gt;
          ; in layers other than 0. Otherwise no action is&lt;br /&gt;
          ; done. It makes no sense for the bottom layer to&lt;br /&gt;
          ; use combine mode anyway.&lt;br /&gt;
          (if (and (&amp;gt; frame 0) (contains-ci (car (gimp-drawable-get-name oldlayer)) &amp;quot;(combine)&amp;quot;))&lt;br /&gt;
            (begin&lt;br /&gt;
              ; Duplicate the previous layer to serve as a base&lt;br /&gt;
              ; for the differencing frame being added.&lt;br /&gt;
              (define layercopy (car (gimp-layer-new-from-drawable (car prevlayerinfo) img)))&lt;br /&gt;
&lt;br /&gt;
              ; Add the new layer below the last layer.&lt;br /&gt;
              (gimp-image-add-layer img layercopy 1)&lt;br /&gt;
&lt;br /&gt;
              ; Set the layer position to match that of the new layer.&lt;br /&gt;
              (gimp-layer-set-offsets layercopy (+ framex (cadr prevlayerinfo))&lt;br /&gt;
                                                (+ framey (caddr prevlayerinfo)))&lt;br /&gt;
&lt;br /&gt;
              ; Ensure the previous layer&#039;s copy is visible.&lt;br /&gt;
              (gimp-drawable-set-visible layercopy TRUE)&lt;br /&gt;
&lt;br /&gt;
              ; Merge the differencing frame into the previous layer&#039;s copy.&lt;br /&gt;
              (set! newlayer (car (gimp-image-merge-down img newlayer EXPAND-AS-NECESSARY)))&lt;br /&gt;
&lt;br /&gt;
              ; Correct the offsets. We use &#039;min&#039; to match what&lt;br /&gt;
              ; EXPAND-AS-NECESSARY has supposedly done. Ideally&lt;br /&gt;
              ; we should read the new offsets and subtract&lt;br /&gt;
              ; framex/framey from them, but this is faster and simpler,&lt;br /&gt;
              (set! offsetx (min offsetx (cadr prevlayerinfo)))&lt;br /&gt;
              (set! offsety (min offsety (caddr prevlayerinfo)))))&lt;br /&gt;
&lt;br /&gt;
          ; Previous layer = this.&lt;br /&gt;
          (set! prevlayerinfo (list newlayer offsetx offsety))&lt;br /&gt;
&lt;br /&gt;
          ; All done. Next loop iteration.&lt;br /&gt;
          (set! frame (+ frame 1))))&lt;br /&gt;
&lt;br /&gt;
      ; Progress 100%&lt;br /&gt;
      (gimp-progress-update 1.0)&lt;br /&gt;
&lt;br /&gt;
      ; Merge visible layers (all are visible now).&lt;br /&gt;
      (define mergedlayer (car (gimp-image-merge-visible-layers img CLIP-TO-IMAGE)))&lt;br /&gt;
&lt;br /&gt;
      ; Make the new layer the size of the image.&lt;br /&gt;
      (gimp-layer-resize-to-image-size mergedlayer)&lt;br /&gt;
&lt;br /&gt;
      ; Convert the image to RGB if it is not already.&lt;br /&gt;
      (if (not (= imgtype RGB))&lt;br /&gt;
        (gimp-image-convert-rgb img))&lt;br /&gt;
&lt;br /&gt;
      ; Detect alpha by converting it to a selection.&lt;br /&gt;
      (gimp-selection-layer-alpha mergedlayer)&lt;br /&gt;
&lt;br /&gt;
      ; If there is no useful alpha, the selection should cover the whole image.&lt;br /&gt;
      ; Invert it, and if it becomes empty, then it means that alpha was not&lt;br /&gt;
      ; in use: the whole image was covered with 100% opacity.&lt;br /&gt;
      (gimp-selection-invert img)&lt;br /&gt;
      (define hasalpha (car (gimp-selection-bounds img)))&lt;br /&gt;
      (gimp-selection-none img)&lt;br /&gt;
&lt;br /&gt;
      ; If it didn&#039;t have any alpha, remove the alpha mask from the layer.&lt;br /&gt;
      (if (= hasalpha FALSE)&lt;br /&gt;
        (gimp-layer-flatten mergedlayer))&lt;br /&gt;
&lt;br /&gt;
      ; All done - enable undo again and add a display window for the new image.&lt;br /&gt;
      (gimp-image-undo-enable img)&lt;br /&gt;
      (gimp-display-new img)&lt;br /&gt;
&lt;br /&gt;
      ; Prepare a version of fps ending in .0 if it doesn&#039;t.&lt;br /&gt;
      (define fpsstr (number-&amp;gt;string fps))&lt;br /&gt;
      (if (not (contains-ci fpsstr &amp;quot;.&amp;quot;))&lt;br /&gt;
        (set! fpsstr (string-append fpsstr &amp;quot;.0&amp;quot;)))&lt;br /&gt;
&lt;br /&gt;
      ; Show the script if requested&lt;br /&gt;
      (if (= showscript TRUE)&lt;br /&gt;
        (gimp-message (string-append &amp;quot;// Copy-paste the following fragment as a script:\n\n&amp;quot;&lt;br /&gt;
                                     &amp;quot;default\n{\n    state_entry()\n    {\n&amp;quot;&lt;br /&gt;
                                     &amp;quot;        llSetTextureAnim(ANIM_ON | LOOP, &amp;quot;&lt;br /&gt;
                                     face&lt;br /&gt;
                                     &amp;quot;, &amp;quot;&lt;br /&gt;
                                     (number-&amp;gt;string xframes)&lt;br /&gt;
                                     &amp;quot;, &amp;quot;&lt;br /&gt;
                                     (number-&amp;gt;string yframes)&lt;br /&gt;
                                     &amp;quot;, 0.0, &amp;quot;&lt;br /&gt;
                                     (number-&amp;gt;string (* xframes yframes))&lt;br /&gt;
                                     &amp;quot;.0, &amp;quot;&lt;br /&gt;
                                     fpsstr &amp;quot;);\n    }\n}\n&amp;quot;))))&lt;br /&gt;
&lt;br /&gt;
    ; If the frame counts didn&#039;t match...&lt;br /&gt;
    (gimp-message &amp;quot;Error: Number of layers doesn&#039;t match horizontal x vertical frames&amp;quot;))))&lt;br /&gt;
&lt;br /&gt;
; Register the function.&lt;br /&gt;
(script-fu-register &amp;quot;script-fu-layers-to-sl-anim&amp;quot;&lt;br /&gt;
                    _&amp;quot;&amp;lt;Image&amp;gt;/Script-Fu/SecondLife/Frames to texture...&amp;quot;&lt;br /&gt;
                    _&amp;quot;Convert a set of layers (frames) to a texture suitable for llSetTextureAnim.&amp;quot;&lt;br /&gt;
                    &amp;quot;Pedro Oval&amp;quot;&lt;br /&gt;
                    _&amp;quot;Public Domain&amp;quot;&lt;br /&gt;
                    &amp;quot;2010-12-04&amp;quot;&lt;br /&gt;
                    &amp;quot;RGB*, GRAY*, INDEXED*&amp;quot;&lt;br /&gt;
                    SF-IMAGE        &amp;quot;Image&amp;quot;        0&lt;br /&gt;
                    SF-DRAWABLE     &amp;quot;Drawable&amp;quot;     0&lt;br /&gt;
                    SF-ADJUSTMENT   _&amp;quot;# of horizontal frames&amp;quot; &#039;(2 1 1024 1 10 0 1)&lt;br /&gt;
                    SF-ADJUSTMENT   _&amp;quot;# of vertical frames&amp;quot;   &#039;(2 1 1024 1 10 0 1)&lt;br /&gt;
                    SF-TOGGLE       _&amp;quot;Generate LSL script?&amp;quot;   TRUE&lt;br /&gt;
                    SF-STRING       _&amp;quot;Face number (ALL__SIDES for all) (for script):&amp;quot; &amp;quot;ALL_SIDES&amp;quot;&lt;br /&gt;
                    SF-VALUE        _&amp;quot;Frames per second (for script):&amp;quot; &amp;quot;10.0&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Change Log ==&lt;br /&gt;
&lt;br /&gt;
* Version 2.0.2 (2015-08-05):&lt;br /&gt;
** Make locals be really local.&lt;br /&gt;
** The generated script did not compile because it lacked the sides parameter. Fixed.&lt;br /&gt;
* Version 2.0.1 (2012-06-05):&lt;br /&gt;
** Disable undo instead of creating an undo group. Makes more sense to the user and saves memory.&lt;br /&gt;
* Version 2.0 (2010-12-22):&lt;br /&gt;
** Frames are no longer required to be the same size as the image.&lt;br /&gt;
** Recognize &amp;quot;combine&amp;quot; layers. Should work with all animated GIFs now.&lt;br /&gt;
** Option to generate the LSL script, active by default.&lt;br /&gt;
** Deal with alpha, so that it&#039;s removed if not needed and vice versa.&lt;br /&gt;
** Added progress indicator.&lt;br /&gt;
** Extensively commented.&lt;br /&gt;
* Version 1.0 (2010-12-04): First public release.&lt;br /&gt;
&lt;br /&gt;
See also [[User:Pedro Oval/GIMP Layers to SL Animated Texture]] for the (possibly unstable) current development version and future plans.&lt;br /&gt;
&lt;br /&gt;
== Credits/License ==&lt;br /&gt;
&lt;br /&gt;
Written by Pedro Oval. Donated to the public domain.&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=PRIM_NORMAL&amp;diff=1196998</id>
		<title>PRIM NORMAL</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=PRIM_NORMAL&amp;diff=1196998"/>
		<updated>2015-07-23T13:14:28Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: Fix typo in sign&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;onlyinclude&amp;gt;{{#if:&lt;br /&gt;
&lt;br /&gt;
{{#vardefine:normal_return|an empty list.}}&lt;br /&gt;
&lt;br /&gt;
{{#vardefine:normal_const|{{LSL Const|PRIM_NORMAL|integer|37|c=Used to {{GetSet|{{{1|}}}|get|set|/}} the normal map settings of a prim&#039;s face}}}}&lt;br /&gt;
&lt;br /&gt;
{{LSL_Function/angle|rotation_in_radians}}&lt;br /&gt;
&lt;br /&gt;
{{#vardefine:p_repeats_desc|x and y range from -100.0 to 100.0, in 0.0001 increments. Negative values flip the texture (z is ignored)}}&lt;br /&gt;
{{#vardefine:p_offsets_desc|x and y range from 0.0 to 1.0, in 0.0001 increments. (z is ignored)}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LSL_Function/inventory|texture|uuid=true|type=texture|no_caveat={{#ifeq:{{{1|}}}|get|true|&amp;lt;noinclude&amp;gt;*&amp;lt;/noinclude&amp;gt;}}|full={{{remote|}}}|remote={{#ifeq:{{{1|set}}}|get|*}}|target=PRIM_NORMAL#Target}}&lt;br /&gt;
&lt;br /&gt;
{{#ifeq:{{{1|}}}|none||&lt;br /&gt;
&lt;br /&gt;
{{#vardefine:facetable|{{#var:facetable}}&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}} [ {{#var:normal_const}} ]&lt;br /&gt;
{{!}} {{#var:normal_return}} }}&lt;br /&gt;
&lt;br /&gt;
{{#vardefine:caveats_get|&lt;br /&gt;
* {{LSLP|repeats}} is not only used to get the number of repeats but the sign of the individual components indicate if &amp;quot;Flip&amp;quot; is set.&lt;br /&gt;
* With {{LSLP|texture}} as with [[llGetTexture]], {{LSL Constant/NULL KEY}} is returned when the {{LSLGC|Owner|owner}} does not have {{LSLGC|Permissions/Asset|full permissions}} to the object and the [[PRIM_NORMAL|texture]] is not in the prim&#039;s inventory.&lt;br /&gt;
*If {{LSLP|face}} indicates a face that exists but does not contain a material, the [[PRIM_NORMAL]] return is &#039;&#039;&#039;[ [[NULL_KEY]], &amp;lt;1,1,0&amp;gt;, [[ZERO_VECTOR]], 0.0 ]&#039;&#039;&#039; }}&lt;br /&gt;
&lt;br /&gt;
{{#vardefine:caveats_set|&lt;br /&gt;
* {{LSLP|repeats}} is not only used to set the number of repeats but the sign of the individual components is also used to set the &amp;quot;Flip&amp;quot; attribute.&lt;br /&gt;
*  To clear the normal map parameters from the face (and possibly remove the material), set  {{LSLP|texture}} to [[NULL_KEY]] (the other parameters must be supplied in this case but will be ignored).&lt;br /&gt;
*  Note that whenever any face in a linkset contains a material (i.e. has a non-default [[PRIM_NORMAL]], [[PRIM_SPECULAR]], or [[PRIM_ALPHA_MODE]]), the linkset will use the [http://community.secondlife.com/t5/English-Knowledge-Base/Calculating-land-impact/ta-p/974163 new accounting system]. }}&lt;br /&gt;
&lt;br /&gt;
{{#ifeq:{{{1|}}}|get|&lt;br /&gt;
&lt;br /&gt;
{{#vardefine:caveats|{{#var:caveats}}&lt;br /&gt;
{{#var:caveats_get}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
{{Issues/SVC-914}}&lt;br /&gt;
{{#vardefine:caveats|{{#var:caveats}}&lt;br /&gt;
{{#var:caveats_set}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{:PRIM TEXGEN|{{{1|}}}}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{#vardefine:shared_caveat|* In the [[PRIM_TEXGEN_DEFAULT|default]] [[PRIM_TEXGEN|texture mapping]] {{LSLP|tg_type|mode}} the [[PRIM_NORMAL|texture]] {{LSLP|repeats}} units are in texture repeats per face. In the [[PRIM_TEXGEN_PLANAR|planar]] texture mapping mode the texture {{LSLP|repeats}} units are in texture repeats per half meter. This is in contrast to the in-world editing tool, in which the planar texture scaling units are repeats per meter.}}&lt;br /&gt;
&lt;br /&gt;
{{#vardefine:caveats|{{#var:caveats}}&lt;br /&gt;
{{#var:shared_caveat}}}}&lt;br /&gt;
&lt;br /&gt;
}}&amp;lt;/onlyinclude&amp;gt;{{#if:&lt;br /&gt;
&lt;br /&gt;
{{#vardefine:caveats_set|{{#var:caveats}}{{#vardefine:caveats|}}}}&lt;br /&gt;
{{#vardefine:issues_set|{{#var:issues}}{{#vardefine:issues|}}}}&lt;br /&gt;
&lt;br /&gt;
{{LSL_Function/face|face|{{#var:normal_const}}|!footer=*|return={{#var:normal_return}}}}&lt;br /&gt;
&lt;br /&gt;
{{#vardefine:caveats_get|{{#var:caveats}}{{#vardefine:caveats|}}&lt;br /&gt;
{{#var:caveats_get}}&lt;br /&gt;
{{#var:shared_caveat}}}}&lt;br /&gt;
{{#vardefine:issues_get|{{#var:issues}}{{#vardefine:issues|}}}}&lt;br /&gt;
&lt;br /&gt;
}}{{LSL Constant&lt;br /&gt;
|inject-2={{LSL PrimitiveParam Categorize|Face}}&lt;br /&gt;
|name=PRIM_NORMAL&lt;br /&gt;
|type=integer&lt;br /&gt;
|value=37&lt;br /&gt;
|desc=Used to get or set the normal map texture settings of a prim&#039;s {{LSLP|face}}.&lt;br /&gt;
|examples=&lt;br /&gt;
|pa={{LSL Constant/List|i_front=[&amp;amp;#32;{{#var:normal_const}},&amp;amp;#32;|i_end=&amp;amp;nbsp;]|&lt;br /&gt;
|inject-1={{#vardefine:p_texture_desc|}}&lt;br /&gt;
{{#vardefine:p_texture_hover|}}&lt;br /&gt;
{{#vardefine:direction|_set}}&lt;br /&gt;
{{LSL_Function/inventory|texture|uuid=true|type=texture}}&lt;br /&gt;
|text=Used with [[llSetPrimitiveParams]] &amp;amp; [[llSetLinkPrimitiveParams]].&lt;br /&gt;
&lt;br /&gt;
{{LSL Generic/Caveats|issues={{#var:issues_set}}|title=*|h=4}}&lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;llSetPrimitiveParams([ PRIM_NORMAL, ALL_SIDES, &amp;quot;1ece3148-6cea-f9eb-2152-9902944dbc3d&amp;quot;, &amp;lt;1.0, 1.0, 0.0&amp;gt;, &amp;lt;0.0, 0.0, 0.0&amp;gt;, 0.0 ]);&lt;br /&gt;
llSetPrimitiveParams([ PRIM_NORMAL, ALL_SIDES, llGetInventoryName(INVENTORY_TEXTURE, 0), &amp;lt;1.0, 1.0, 0.0&amp;gt;, &amp;lt;0.0, 0.0, 0.0&amp;gt;, 0.0 ]);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|toc=llSetPrimitiveParams&lt;br /&gt;
|i1_type=integer|i1_name=face&lt;br /&gt;
|i2_type=string|i2_name=texture&lt;br /&gt;
|i3_type=vector|i3_name=repeats&lt;br /&gt;
|i4_type=vector|i4_name=offsets&lt;br /&gt;
|i5_type=float|i5_name=rotation_in_radians|i5_disp=rot&lt;br /&gt;
}}&lt;br /&gt;
|pb={{LSL Constant/List|i_front=[[llGetPrimitiveParams]]([&amp;amp;nbsp;{{#var:normal_const}},&amp;amp;#32;|i_end=&amp;amp;nbsp;]);|&lt;br /&gt;
|inject-1={{#vardefine:p_texture_desc|}}&lt;br /&gt;
{{#vardefine:p_texture_hover|}}&lt;br /&gt;
{{#vardefine:direction|_get}}&lt;br /&gt;
{{LSL_Function/inventory|texture|uuid=true|type=texture|no_caveat=true|full={{{remote|}}}|remote=*|target=#Target}}&lt;br /&gt;
{{LSL Function/link|link|nogroup=*|nocaveats=*}}&lt;br /&gt;
|r_front=Returns the list [&amp;amp;nbsp;|r_end=&amp;amp;nbsp;]&lt;br /&gt;
|text=&lt;br /&gt;
{{LSL Generic/Caveats|caveats={{#var:caveats_get}}{{#vardefine:caveats_get}}|issues={{#var:issues_get}}|title=*|h=4}}&lt;br /&gt;
====Target====&lt;br /&gt;
In the case of llGetPrimitiveParams is either the prim the script resides in, or the prim specified by the immediately prior [[PRIM_LINK_TARGET]] call. However in the case of llGetLinkPrimitiveParams, it is either the value of the {{LSLP|link}} parameter, or the prim specified by the immediately prior [[PRIM_LINK_TARGET]] call.&lt;br /&gt;
|toc=llGetPrimitiveParams&lt;br /&gt;
|i1_type=integer|i1_name=face&lt;br /&gt;
|r1_type=string|r1_name=texture&lt;br /&gt;
|r2_type=vector|r2_name=repeats&lt;br /&gt;
|r3_type=vector|r3_name=offsets&lt;br /&gt;
|r4_type=float|r4_name=rotation_in_radians|r4_disp=rot&lt;br /&gt;
}}&lt;br /&gt;
|functions=&lt;br /&gt;
{{LSL DefineRow||[[llSetPrimitiveParams]]|}}&lt;br /&gt;
{{LSL DefineRow||[[llSetLinkPrimitiveParams]]|}}&lt;br /&gt;
{{LSL DefineRow||[[llGetPrimitiveParams]]|}}&lt;br /&gt;
|events&lt;br /&gt;
|location&lt;br /&gt;
|notes&lt;br /&gt;
|cat1=Texture&lt;br /&gt;
|cat2&lt;br /&gt;
|cat3&lt;br /&gt;
|cat4&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Limits&amp;diff=1196994</id>
		<title>Limits</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Limits&amp;diff=1196994"/>
		<updated>2015-07-22T19:34:58Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: /* All Viewers */ Add note  on minimum&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{KBmaster}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
== Summary ==&lt;br /&gt;
{{RightToc}}&lt;br /&gt;
The Second Life Viewer and simulators have a division of labor, keeping track of the data that makes Second Life run. The Viewer&#039;s job is to:&lt;br /&gt;
&lt;br /&gt;
* Handle locations of objects.&lt;br /&gt;
* Get velocities and other physics information, and does simple physics to keep track of what is moving where.&lt;br /&gt;
&lt;br /&gt;
The simulator&#039;s job is to:&lt;br /&gt;
&lt;br /&gt;
* Run the physics engine.&lt;br /&gt;
* Detect collisions.&lt;br /&gt;
* Keep track of where everything is&lt;br /&gt;
* Send locations of content to the Viewer along with updates when certain changes occur.&lt;br /&gt;
&lt;br /&gt;
Limits are necessary for all of these components to work together. The list below outlines many of the &#039;&#039;&#039;Second Life numerical limits that affect your inworld experience&#039;&#039;&#039;. Some of these will likely change over time, so if you spot something incorrect/outdated, please take a moment to update it.&lt;br /&gt;
&lt;br /&gt;
{{KBcaution|1=The scope of this page is focused on Linden Lab&#039;s official Viewers, keeping in mind [[Third_Party_Viewer_Directory|3rd-party viewers may differ]]. Cite sources and provide substantiation for limits that aren&#039;t provided by Linden Lab. Also, unconfirmed speculation [[Talk:Limits|goes on this discussion page]]. Don&#039;t add data without a hard limit, and don&#039;t add obscure trivia that doesn&#039;t practically affect the general inworld experience.|width=80%}}&lt;br /&gt;
&lt;br /&gt;
== [[Avatar]] ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Max. # of attachments&#039;&#039;&#039; - 38 combined [[HUD]] or body attachments.&lt;br /&gt;
** They can be viewed by right-clicking your avatar and choosing &#039;&#039;&#039;Edit My Outfit&#039;&#039;&#039;.&lt;br /&gt;
** With the formal introduction of [[multiple attachments|multiple attachments to a single point]] in Viewer 2.4, you can attach up to 38 total objects, and they can all be attached to a single point. &lt;br /&gt;
* &#039;&#039;&#039;Max. # of clothing layers&#039;&#039;&#039; - 60 including alpha, tattoo, shoe base, physics, socks, gloves, undershirt, underpants, shirt, pants, jacket, skirt&lt;br /&gt;
** On viewers before Second Life Release 3.7.29.301305, the potential total was still 60, but limited to 5 items of each type.&lt;br /&gt;
** In any case, only one each of shape, skin, eyes and hair base may be worn.&lt;br /&gt;
* &#039;&#039;&#039;Max Clothing Texture&#039;&#039;&#039; - 512x512 px (except 128x128 px for eyes) - Server Side Appearance (and legacy baking on outside grids) will downsize larger textures.&amp;lt;!--per Nyx Linden 9/23/2013 Content n Mesh Meeting--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Max. unassisted fly height&#039;&#039;&#039; - Stable hover at current ground elevation &#039;&#039;plus&#039;&#039; 5020m.&lt;br /&gt;
** You can easily acquire a flight attachment to fly high. Also see [[flight limit]] and [[Limits#Navigation|the Navigation section]] below.&lt;br /&gt;
* &#039;&#039;&#039;Common shoe sizes&#039;&#039;&#039; - Traditionally, most women&#039;s shoes were designed for a size 0 (zero) foot. Men&#039;s generally scale up to 14. Newer items (mesh and some sculpted) replace the system feet or conform to the avatar&#039;s shape, so adjustments may be necessary.&lt;br /&gt;
** You can check this by going to Edit menu &amp;gt; Appearance and clicking on the Shape &amp;gt; Legs tab.&lt;br /&gt;
&amp;lt;!--Can someone verify the following?&lt;br /&gt;
* &#039;&#039;&#039;Min. length of avatar name&#039;&#039;&#039; - 2 for first name, 2 for last name, 5 in total (including the space).--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Max. length of avatar name&#039;&#039;&#039; - 31 for first name, 31 for last name, 63 in total (including the space).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Max. length of {{LSLGC|Username}}&#039;&#039;&#039; - All lower case and a maximum of 63 including the &#039;.&#039;(eg; firstname.lastname)&lt;br /&gt;
**Older account user names are a combination of the First and last name in lower case separated by a period(.)(eg; lilmix.pixelmaid)&lt;br /&gt;
**Modern user names are a single name(no period)(eg; john1234) - &#039;&#039;&#039;Max.&#039;&#039;&#039; length is 31 characters&lt;br /&gt;
**The {{LSLGC|Legacy Name}}s for modern user names always shows Resident as the last name. So the Max is 40 characters in total for a new avatar&#039;s legacy name(including the space and last name &#039;Resident&#039;)&lt;br /&gt;
*&#039;&#039;&#039;Min. length of [[Display_Names]]&#039;&#039;&#039; - At least one script character&lt;br /&gt;
*&#039;&#039;&#039;Max. length of Display Names&#039;&#039;&#039; - 31 characters&lt;br /&gt;
**Display Names can include most Unicode script characters, spaces, and some punctuation.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Max. avatar speed&#039;&#039;&#039; - 250m/s (with only attachments to assist)&lt;br /&gt;
* &#039;&#039;&#039;Max. teleport speed&#039;&#039;&#039;&amp;lt;!-- - 3 teleports per 15 seconds (server 1.27.0) and 10 teleports per 15 seconds (server 1.27.1)--&amp;gt; - 10 teleports per 15 seconds, since SL server 1.27.1&lt;br /&gt;
&lt;br /&gt;
== [[Animation]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||Length of animation&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|60.0 seconds}}&lt;br /&gt;
| Limited by length or Size, whichever is reached first&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Size of Animation&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|120k bytes}}&lt;br /&gt;
| Limited by length or Size, whichever is reached first. Size is after conversion to SL [[Internal Animation Format|internal animaton format]], not BVH source which can be much larger.&lt;br /&gt;
| n/a&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||animation priority&lt;br /&gt;
| {{no|0}}&lt;br /&gt;
| {{no|4, with custom tools 6}}&lt;br /&gt;
| n/a&lt;br /&gt;
| [[Animation_Priority]]&lt;br /&gt;
|-&lt;br /&gt;
||Number of unique joints per animation&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|32}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== [http://community.secondlife.com/t5/English-Knowledge-Base/Build-Tools/ta-p/700039 Building] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||[[Prim]] dimensions&lt;br /&gt;
| {{no|&amp;lt;0.01,&amp;amp;nbsp;0.01,&amp;amp;nbsp;0.01&amp;gt;}}&lt;br /&gt;
| {{no|&amp;lt;64.0, 64.0, 64.0&amp;gt;}}&lt;br /&gt;
| Used to be &amp;lt;10.0, 10.0, 10.0&amp;gt; prior to Second Life Server version 11.08.17.238770&lt;br /&gt;
| [[llSetScale]], [[PRIM_SIZE]] and [[Megaprim]]&lt;br /&gt;
|-&lt;br /&gt;
||Number of prims in a linkset&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|256 prims}}&lt;br /&gt;
| Used to be 255 prior to Second Life Server version 1.26&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Linking distance&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|[[Linkability_Rules]]}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||[[Mesh/Mesh_physics#Physics_Resource_Cost|Physics cost]] for a physical object&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|32.0}}&lt;br /&gt;
||Additional notes:&lt;br /&gt;
* If you try to link more, it&#039;ll either say &amp;quot;Can&#039;t enable physics for objects with more than 32 primitives&amp;quot; or &amp;quot;Object has too many primitives -- its dynamics have been disabled.&amp;quot;.&lt;br /&gt;
* On server versions 1.38 and below, each sitting avatar counted as 1 prim. From 1.40.2 the limit is only on actual prims.&lt;br /&gt;
| [[OBJECT_PHYSICS_COST]]&lt;br /&gt;
|-&lt;br /&gt;
||Build or rez height&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|4096.0 meters}}&lt;br /&gt;
| 768.0 meters for Viewers prior to version 1.20&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Prim name length&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|63 bytes UTF-8 [[String|string]]}}&lt;br /&gt;
| same limit for {{LSLGC|Avatar/Name|avatar names}}, although the character set for avatar names is significantly limited.&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Prim description length&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|127 bytes UTF-8 [[String|string]]}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Temporary prims&#039; lifetime&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|up to around 60 seconds}}&lt;br /&gt;
| depends upon when the next garbage collector cycle is&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Number of temporary prims&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|RegionPrimLimit - NumberOfPrimsInRegion + Minimum(0.5*RegionPrimLimit, 1000)}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Length of hovertext&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|254 bytes UTF-8 [[String|string]]}}&lt;br /&gt;
| n/a&lt;br /&gt;
| [[llSetText]] and [[PRIM_TEXT]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== [[Communication]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||Whisper distance&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|10 meters}}&lt;br /&gt;
| &amp;lt;code&amp;gt;/whisper&amp;lt;/code&amp;gt; as the first few characters in a message can be used in viewer-2-code based viewers in local chat.&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Chat distance&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|20 meters}}&lt;br /&gt;
| text spoken as a &amp;quot;chat&amp;quot; step &#039;&#039;&#039;within gestures&#039;&#039;&#039; cannot be shouted or whispered. /whisper and /shout &#039;&#039;can&#039;&#039; be used in the &amp;quot;Replace with&amp;quot; field.&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Shout distance&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|100 meters}}&lt;br /&gt;
| &amp;lt;code&amp;gt;/shout&amp;lt;/code&amp;gt; as the first few characters in a message can be used in viewer-2-code based viewers in local chat.&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Length of a chat message and whether or not it is truncated&lt;br /&gt;
| {{no|1 byte or single-byte character}}&lt;br /&gt;
| {{no|1024 bytes or single-byte characters}}&lt;br /&gt;
| Limit does not apply to instant messages via [[llInstantMessage]] and communication between IM and email, the limit there is 1023 bytes or single-byte characters.&lt;br /&gt;
&lt;br /&gt;
The viewer-to-server communication on &#039;&#039;negative&#039;&#039; channels is truncated to 254 bytes, and on &#039;&#039;positive&#039;&#039; channels, to 1023 bytes. These limits do not affect communication between scripts.&lt;br /&gt;
| [[llInstantMessage]]&lt;br /&gt;
|-&lt;br /&gt;
||Number of offline messages&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|Capped at 25 messages, unless the account has a Premium Subscription, in which case the cap raises to 50 messages.}}&lt;br /&gt;
| Number of offline messages (involving [[IM|IMs]], inventory offers, group notices, group invitations) received before messages get capped. Note: If autoAcceptNewInventory (debug setting) is set to TRUE (the default is FALSE), then all inventory offers, even above 25 (or 50 in the case of Premium members), go directly to inventory and do not count against the cap on offline messages. &lt;br /&gt;
| [[IM]] - [https://community.secondlife.com/t5/Featured-News/A-New-Perk-for-Premium-Subscribers/ba-p/2917357 Blog Post]&lt;br /&gt;
|-&lt;br /&gt;
||Length of a properly delivered email reply to an [[IM]]&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|1023 bytes or single-byte characters}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Time after which a reply to an [[IM]] can be sent via email.&lt;br /&gt;
| {{no|when receiving the IM via email.}}&lt;br /&gt;
| {{no|5 days after receiving the offline IM via email.}}&lt;br /&gt;
| n/a&lt;br /&gt;
| [https://blogs.secondlife.com/community/features/blog/2007/02/06/im-to-e-mail-return-addresses-changing Second Life Blogs]&lt;br /&gt;
|-&lt;br /&gt;
||Time period for which [[IM|IMs]] are stored within Second Life.&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|31 days after receiving the [[IM]]}}&lt;br /&gt;
| [[User:Torley_Linden|Torley Linden]] confirmed this with [[User:Kelly_Linden|Kelly Linden]]&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Number of [[IM|IMs]] sent by an object within an hour&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|5000 per hour}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== [[Gesture]]s ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||Shortcut key mappings&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|33 unique combinations, since {{K|F2}}&amp;amp;ndash;{{K|F12}} can be used with the {{K|Ctrl}} or {{K|Shift}} modifiers.}}&lt;br /&gt;
| n/a&lt;br /&gt;
| [[All_keyboard_shortcut_keys]] and [http://community.secondlife.com/t5/English-Knowledge-Base/Keyboard-shortcuts/ta-p/1086557 the knowledge base]&lt;br /&gt;
|-&lt;br /&gt;
||Chat step length&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|127 bytes or single-byte characters}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Wait time&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|3600 seconds (which is one hour)}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
| Maximum steps data&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|1000 bytes}} of packed data; saving with more data returns the message &amp;quot;Gesture save failed. This gesture has too many steps. Try removing some steps, then save again.&amp;quot; Shorter text, for example, will allow more steps.&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Length of included assets&lt;br /&gt;
| n/a&lt;br /&gt;
| see sections for [[#Animation|animation]], [[#Sound|sound]]&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== [[Group]]s ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of groups you can belong to:&#039;&#039;&#039; 42 for Basic accounts, 60 for Premium accounts.&lt;br /&gt;
** After downgrading from a Premium account to a Basic account, you may not join any new groups until you are a member of fewer than 42 groups.&lt;br /&gt;
** Roles within groups are sort of like sub-groups. In many cases, you can use them instead of creating new groups.&lt;br /&gt;
* &#039;&#039;&#039;Minimum number of members in a group:&#039;&#039;&#039; 2&lt;br /&gt;
** A group with only 1 person for 48 hours will be disbanded (cancelled). Unless the group owns land.&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of roles allowed in a group:&#039;&#039;&#039; 10 (including &amp;quot;Owners&amp;quot; and &amp;quot;Everyone&amp;quot;, which cannot be deleted)&lt;br /&gt;
* &#039;&#039;&#039;Maximum Group Name:&#039;&#039;&#039; 35 single-byte characters.&lt;br /&gt;
* &#039;&#039;&#039;Maximum Group Title:&#039;&#039;&#039; 20 single-byte characters.&lt;br /&gt;
* &#039;&#039;&#039;Maximum Length of a Group Notice:&#039;&#039;&#039; 512 single-byte characters.&lt;br /&gt;
&lt;br /&gt;
== [[Inventory]] ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of inventory items that can be sent in a folder:&#039;&#039;&#039; 42&lt;br /&gt;
** Folders count as items too. This has more to do with packet size limits than cheeky Douglas Adams references.&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of inventory items that can be contained in a prim:&#039;&#039;&#039; None, but more items increase the loading time when you open it.&lt;br /&gt;
* &#039;&#039;&#039;Maximum characters in an inventory item name:&#039;&#039;&#039; 63&lt;br /&gt;
* &#039;&#039;&#039;Maximum notecard line:&#039;&#039;&#039; None, but scripts can only read the first 255 bytes.&lt;br /&gt;
* &#039;&#039;&#039;Maximum notecard size:&#039;&#039;&#039; 65,536 bytes&lt;br /&gt;
* &#039;&#039;&#039;Number of items in the Library:&#039;&#039;&#039; 1,248 as of 2010-06-17&lt;br /&gt;
* &#039;&#039;&#039;Number of items in the Library:&#039;&#039;&#039; 2,210 as of 2012-11-04&lt;br /&gt;
** Verified by [[How_does_the_Library_work|hiding the Library]] and counting the difference.&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of inventory items displayed in a single inventory folder:&#039;&#039;&#039; Several thousand. &amp;lt;!-- not a specific item count, because the data is variable size, but still useful to document that there is a limit. --&amp;gt;&lt;br /&gt;
** This was discussed during [http://wiki.secondlife.com/wiki/Simulator_User_Group/Transcripts/2011.03.08] &amp;quot;the folder will load up to the limit number of items, and remaining ones won&#039;t show up in the viewer. you still own them, they aren&#039;t lost, but they will be hidden until the folder size is reduced.&amp;quot;&lt;br /&gt;
** There is no specified limit for total avatar inventory, very large folders can be split.&lt;br /&gt;
** There was discussion in the Third Party Developers&#039; UG (4/10/2015) meeting about new inventory and login problems from having large numbers of items in a single folder. AISv3 &#039;&#039;removed&#039;&#039; server side limits on the number of items in a folder. Flat inventories are bad. No one is certain at what number of items in a folder cause a login problem. The fix is to clear the inventory cache (not the viewer cache) and log into a deserted, empty region then move inventory items into folders and sub-folders. - The problem appears at different a number of items depending on your computer and connection speed. Hopefully being on an empty region will give one enough edge to get logged in and do some corrective work before being dropped.&lt;br /&gt;
&lt;br /&gt;
== [[Land]] ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Maximum [[Land#Parcel|parcel]] size:&#039;&#039;&#039; 65,536 meters²&lt;br /&gt;
** Covering a whole region, or square on the World Map.&lt;br /&gt;
* &#039;&#039;&#039;Minimum parcel size:&#039;&#039;&#039; 16 meters²&lt;br /&gt;
* &#039;&#039;&#039;Maximum parcel name length:&#039;&#039;&#039; 63 single-byte characters&lt;br /&gt;
* &#039;&#039;&#039;Maximum parcel description length:&#039;&#039;&#039; 255 characters&lt;br /&gt;
* &#039;&#039;&#039;Region name length:&#039;&#039;&#039; Under Linden Concierge policy, minimum of 3 characters, and a maximum of 25 characters (including spaces). See [[Linden Lab Official:Guidelines for Private Region Naming|Guidelines for Private Region Naming]].&lt;br /&gt;
** Rare exceptions exist, like [http://slurl.com/secondlife/X/128/128/24 X].&lt;br /&gt;
* &#039;&#039;&#039;Maximum ban line height for &amp;quot;no entry&amp;quot; or &amp;quot;pay to access&amp;quot;&#039;&#039;&#039; (in other words, &amp;quot;allow public access&amp;quot; is turned off, or &amp;quot;allow group access&amp;quot; is turned on, in the parcel options) is the parcel&#039;s ground elevation &#039;&#039;plus&#039;&#039; 50 meters. If a user is &#039;&#039;&#039;explicitly banned by name&#039;&#039;&#039;, the height is the parcel&#039;s ground elevation &#039;&#039;plus&#039;&#039; 5000 meters. On current viewers this is visible to the full extent.&lt;br /&gt;
* &#039;&#039;&#039;Maximum prims in a [[Land#Region|region]]:&#039;&#039;&#039;&lt;br /&gt;
** Full region: 15,000&lt;br /&gt;
** [[Land#Homestead|Homestead]]: 3,750&lt;br /&gt;
** [[Land#Openspace|Openspace]]: 750&lt;br /&gt;
* &#039;&#039;&#039;Maximum auto return value&#039;&#039;&#039;: Besides &amp;quot;0&amp;quot; (which means &#039;&#039;never&#039;&#039;), {{HoverText|999,999|Almost 23 months}} minutes is the highest auto return value.&lt;br /&gt;
* &#039;&#039;&#039;Terraforming limits:&#039;&#039;&#039;&lt;br /&gt;
** Most mainland can be raised/lowered by 4 meters (+/-).&lt;br /&gt;
** Some mainland cannot be terraformed, including: Bay City regions, Boardman, Brown, De Haro, Kama City regions, Nautilus City regions, Nova Albion regions, and Shermerville regions.&lt;br /&gt;
** [http://community.secondlife.com/t5/English-Knowledge-Base/Linden-Homes/ta-p/700103 Linden Homes] do not allow terraforming.&lt;br /&gt;
** A few, very old mainland Regions like Da Boom have a terraform range of 40 meters (+/-).&lt;br /&gt;
** Estate (private island) terraformability is settable to a maximum of 100 meters (+/-) by the estate owner or managers.&lt;br /&gt;
* &#039;&#039;&#039;Maximum water height:&#039;&#039;&#039; 100 meters using inworld controls, 255 meters by using a *.raw file upload.&lt;br /&gt;
** Region water height is usually 20 meters, and adjacent regions should have the same water height, or else they will look discontinuous.&lt;br /&gt;
* &#039;&#039;&#039;Maximum terrain height:&#039;&#039;&#039; 255 meters using inworld controls (mainland limit), 510 meters by using a *.raw file upload.&lt;br /&gt;
* &#039;&#039;&#039;Miscellaneous estate limits:&#039;&#039;&#039; You can have a maximum of 10 estate managers, 500 allowed Residents, 63 allowed groups, and 500 banned Residents.&lt;br /&gt;
** See World menu &amp;gt; Region/Estate &amp;gt; Estate tab.&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of agents&#039;&#039;&#039;&lt;br /&gt;
** Full region: 100 (Typically set to 40 on mainland, 55 on Linden Homes regions, but this does vary. Some meeting areas have this set to 60 and higher.)&lt;br /&gt;
*** Recent server performance improvements make regions with 60 agents in them perform quite well.&lt;br /&gt;
** [[Land#Homestead|Homestead]]: 20&lt;br /&gt;
** [[Land#Openspace|Openspace]]: 10&lt;br /&gt;
* &#039;&#039;&#039;Freeze Time:&#039;&#039;&#039; Land owners can [[freeze]] other Residents for up to 30 seconds.  Members of land owning groups can also be granted this ability.&lt;br /&gt;
* &#039;&#039;&#039;Minimum parcel that can be listed in Places or All search:&#039;&#039;&#039; 144 meters² &amp;lt;!-- 128 and under are disabled --&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Minimum parcel that can be listed in Events:&#039;&#039;&#039; 512 meters²&lt;br /&gt;
* &#039;&#039;&#039;Maximum altitude for event listings:&#039;&#039;&#039;  768 meters ({{JIRA|WEB-814}})&lt;br /&gt;
* &#039;&#039;&#039;Maximum heights that objects can be seen on the [[World Map]]:&#039;&#039;&#039; 400.005m&lt;br /&gt;
&lt;br /&gt;
== [[Mesh]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||Number of vertices&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|65536 vertices per LOD for each [[mesh]] - See [[Talk:Limits#Mesh_Limits|discussion page]]}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||COLLADA file size&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|Maximum mesh asset size after compression is 8 MB, roughly equivalent to a 256 MB Raw COLLADA file.}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Bone influence weights per vertex&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|4}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Number of materials per mesh&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|8}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Number of materials per face&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|1}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Physics weight for a vehicle&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|32.0}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===User Found Temporary Mesh limits:===&lt;br /&gt;
&#039;&#039;Because of an apparent bug in the importer stay within these limits.&#039;&#039;&lt;br /&gt;
* 174,752 triangles, beyond which additional triangles will appear as holes.&lt;br /&gt;
* The 64k vertices per material is pre-empted by a limit of 21,844 triangles per material, which is presently reported as {{Jira|BUG-1001}}. (4/2014 - See [[Talk:Limits#Mesh_Limits|discussion page]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:: The import process will continue making new materials beyond 8 x 21,844 (=174,752) triangles, but the extra triangles then get dropped by the limitation to 8 materials, causing holes in the resulting object. Over the 21,844 triangle limit, the vertex count will start to climb steeply, even with smooth shading, because the materials get highly interspersed. So the same vertices have to appear in multiple material lists. So the moral of the story is to stay below 21,844 triangles per material, for now, if you want to avoid some unexpected effects.&lt;br /&gt;
&lt;br /&gt;
== Misc. ==&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;[https://secondlife.com/currency/describe-limits.php Billing and Trading Limits]&#039;&#039;&#039; - Includes [https://secondlife.com/whatis/economy-market.php LindeX] currency exchange limits.&lt;br /&gt;
*&#039;&#039;&#039;Contacts in Communication &amp;gt; Friends tab &#039;&#039;&#039; - A maximum of 20 simultaneous contacts can be selected to change permissions, remove, or invite for a conference chat.&lt;br /&gt;
&lt;br /&gt;
== Navigation ==&lt;br /&gt;
&lt;br /&gt;
[[File:Max Alt.jpg|thumb|right|435px|&#039;&#039;&#039;Height counter error above 2147483647 meters&#039;&#039;&#039;]]&lt;br /&gt;
* &#039;&#039;&#039;Absolute height limit:&#039;&#039;&#039; [http://en.wikipedia.org/wiki/2147483647#2147483647_in_computing 2147483647]&amp;amp;nbsp;=&amp;amp;nbsp;2&amp;lt;sup&amp;gt;31&amp;lt;/sup&amp;gt;&amp;amp;nbsp;−&amp;amp;nbsp;1 meters, which causes the altitude counter to roll over. Altitudes well below this cause graphics errors probably due to limited floating point number precision.&lt;br /&gt;
* &#039;&#039;&#039;Highest z-value of an [[SLurl]], that will still teleport you to a positive altitude:&#039;&#039;&#039; 4096&lt;br /&gt;
** This used to be much higher, but is clamped in late model viewers.&lt;br /&gt;
&lt;br /&gt;
== [[Profile]] ==&lt;br /&gt;
&lt;br /&gt;
Each 7-bit ASCII character is encoded in one byte. International characters might need more bytes. When pasting text instead of typing, you can get in one byte more into each of the below.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;2nd Life tab&#039;s About field&#039;&#039;&#039; - 510 bytes&lt;br /&gt;
* &#039;&#039;&#039;Picks tab&#039;&#039;&#039; - 10 picks with 1022 bytes each&lt;br /&gt;
* &#039;&#039;&#039;1st Life tab&#039;s Info field&#039;&#039;&#039; - 253 bytes&lt;br /&gt;
* &#039;&#039;&#039;Classified tab&#039;&#039;&#039; - 100 listings with x bytes each&lt;br /&gt;
* &#039;&#039;&#039;My Notes&#039;&#039;&#039; - 1022 bytes&lt;br /&gt;
&lt;br /&gt;
== Performance ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Healthy Viewer FPS&#039;&#039;&#039; - Generally, FPS above 15 is good. The higher it gets, the smoother. You can check via [[Advanced]] menu &amp;gt; Performance Tools &amp;gt; Lag Meter, or for more advanced usage, see Advanced &amp;gt; Performance Tools &amp;gt; Statistics Bar.&lt;br /&gt;
* &#039;&#039;&#039;Avatar Rendering Cost scores&#039;&#039;&#039; - [[Avatar Rendering Cost|Learn all about it!]]&lt;br /&gt;
&lt;br /&gt;
== [[Scripting]] == &amp;lt;!-- Important scripting limits should be placed here, less important ones should be in the articles Caveats or Specification sections --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Height at which scripts reactivate on a no-script parcel&#039;&#039;&#039; - 50 m above terrain mesh. Scripted objects that take controls will keep running when you fly down or enter a no-script parcel. (If scripts are disabled in the region debug panel, they will not run at any height.)&lt;br /&gt;
* &#039;&#039;&#039;Maximum height where scripts can run&#039;&#039;&#039; - none, as long as the object remains rezzed or attached.&lt;br /&gt;
* &#039;&#039;&#039;Maximum script source code size&#039;&#039;&#039; - 65536 single byte characters (that&#039;s a viewer limit and can be changed in the config file &#039;panel_script_ed.xml&#039;).&lt;br /&gt;
* &#039;&#039;&#039;Maximum script memory size (LSO)&#039;&#039;&#039; - 16384 bytes.&lt;br /&gt;
* &#039;&#039;&#039;Maximum script memory size (Mono)&#039;&#039;&#039; - 65536 bytes (the maximum memory available to Mono scripts can be constrained via [[llSetMemoryLimit]]).&lt;br /&gt;
* &#039;&#039;&#039;Maximum active [[llListen|listeners]] per script&#039;&#039;&#039; - 65.&lt;br /&gt;
** &#039;&#039;&#039;Usable channel for each listener&#039;&#039;&#039; - &#039;&#039;min.&#039;&#039; -2147483648, &#039;&#039;max.&#039;&#039; 2147483647, including the following special channels: [[PUBLIC_CHANNEL]] &#039;&#039;and&#039;&#039; [[DEBUG_CHANNEL]].&lt;br /&gt;
* For specific scripting limits, look up calls in the &#039;&#039;&#039;[[LSL Portal]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== [[Sound]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||Sound length&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|10.00000 seconds (441,000 samples)}}&lt;br /&gt;
| 441,001 samples (10.00002 seconds) won&#039;t work. You&#039;re advised to cut longer sounds into 9.9-second-pieces.&lt;br /&gt;
| n/a&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== [[Textures]] ==&lt;br /&gt;
* &#039;&#039;&#039;[http://en.wikipedia.org/wiki/Aspect_ratio Aspect ratios]&#039;&#039;&#039; of profile, place, etc. pictures — all of these were measured at UI size (Edit menu &amp;gt; Preferences &amp;gt; General tab &amp;gt; UI Size) = 1.000:&lt;br /&gt;
&lt;br /&gt;
=== Second Life Viewer 3.6 ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Classifieds thumbnail&#039;&#039;&#039; - ~3:2 (101&amp;amp;times;69 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Classifieds expanded&#039;&#039;&#039; - ~4:3 (159&amp;amp;times;120 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Classifieds expanded &amp;gt; More Info&#039;&#039;&#039; - native aspect ratio&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Destination Guide thumbnail&#039;&#039;&#039; - ~3:2 (101&amp;amp;times;69 pixels) &lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Destination Guide expanded&#039;&#039;&#039; - ~4:3 (159&amp;amp;times;120 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; People&#039;&#039;&#039; - 1:1 (100&amp;amp;times;100 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Places expanded&#039;&#039;&#039; ~4:3 (159&amp;amp;times;120 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Place Profile&#039;&#039;&#039; - ~3:2 (290&amp;amp;times;197 pixels)&lt;br /&gt;
* &#039;&#039;&#039;About Land &amp;gt; Options tab&#039;&#039;&#039; - ~4:3 (195&amp;amp;times;150 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Picture&#039;&#039;&#039; - native aspect ratio; thumbnail cropped to 72&amp;amp;times;72 pixels; zoomed uncropped up to 300&amp;amp;times;300 pixels&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Real world picture&#039;&#039;&#039; - native aspect ratio; thumbnail cropped to 45&amp;amp;times;45 pixels; zoomed uncropped up to 300&amp;amp;times;300 pixels&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Picks thumbnail&#039;&#039;&#039; - 4:3 (60&amp;amp;times;45 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Pick expanded&#039;&#039;&#039; - 4:3 (320&amp;amp;times;240 pixels)&lt;br /&gt;
&lt;br /&gt;
=== 1.x Series Viewers ===&lt;br /&gt;
(official Viewer up to 1.23.5, still used by some [[Alternate viewers|Third Party Viewers]])&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; All for &amp;quot;Classifieds&amp;quot;, &amp;quot;People&amp;quot;, and &amp;quot;Places&amp;quot;&#039;&#039;&#039; - 4:3 (256&amp;amp;times;192 pi&amp;amp;times;els)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Places and Classified tabs&#039;&#039;&#039; - ~7:5 (398&amp;amp;times;282 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Land tab&#039;&#039;&#039; - ~7:5 (358&amp;amp;times;252 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; 2nd Life tab&#039;&#039;&#039; - ~4:3 (178&amp;amp;times;133 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Picks tab&#039;&#039;&#039; - 16:9 (288&amp;amp;times;162 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; 1st Life tab&#039;&#039;&#039; - 1:1 (133&amp;amp;times;133 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Classifieds tab&#039;&#039;&#039; - ~3:2 (206&amp;amp;times;137 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Web tab&#039;&#039;&#039; - 1:1 (400&amp;amp;times;400 pixels)&lt;br /&gt;
** A scrollbar uses 15 pixels on the right-hand side.&lt;br /&gt;
* &#039;&#039;&#039;About Land &amp;gt; Options tab&#039;&#039;&#039; - ~3:2 (178&amp;amp;times;117 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Group Information &amp;gt; General tab&#039;s &amp;quot;Group Insignia&amp;quot;&#039;&#039;&#039; - 1:1 (126&amp;amp;times;126 pixels)&lt;br /&gt;
** Some of these textures are shared (for example, Search &amp;gt; All place pages, Search &amp;gt; Places, and About Land &amp;gt; Options use the same image), so you should pick a well-balanced ratio and size.&lt;br /&gt;
** [[Texture_aspect_ratios|Learn how to get correct texture aspect ratios when editing images.]]&lt;br /&gt;
&lt;br /&gt;
=== All Viewers ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Maximum texture size&#039;&#039;&#039; - 1024&amp;amp;times;1024 pixels&lt;br /&gt;
** All Second Life textures are constrained to [http://en.wikipedia.org/wiki/Power_of_2 powers of 2] (e.g., 128, 256, 512).&lt;br /&gt;
** Some textures inworld have a resolution as high as 2048&amp;amp;times;2048; this is due to a previous limit that was higher.&lt;br /&gt;
** We strongly recommend you use as small textures as possible because larger ones consume more memory and take substantially longer to load.&lt;br /&gt;
** Where large textures are being forced by import to only 512&amp;amp;times;512, lower your ...&amp;gt; Preferences &amp;gt;...&amp;gt; UI Size under 1.0, to increase import size to the max 1024&amp;amp;times;1024.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Minimum texture size&#039;&#039;&#039; - 4&amp;amp;times;4 pixels&lt;br /&gt;
** This means that there are nine possible image dimensions: 4, 8, 16, 32, 64, 128, 256, 512, and 1024 pixels, either horizontal or vertical.&lt;br /&gt;
&lt;br /&gt;
[[Category:Creation]] [[Category:Tutorials]] [[Category:Lists]]&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
In general 1 byte is enough to contain one character.&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Template:LSL_Animation_States&amp;diff=1196971</id>
		<title>Template:LSL Animation States</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Template:LSL_Animation_States&amp;diff=1196971"/>
		<updated>2015-07-15T15:23:04Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: Add defaults&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{{!}} class=&amp;quot;sortable&amp;quot; {{Prettytable|style=margin-top:0;}}&lt;br /&gt;
{{!}}+{{{title|}}}&lt;br /&gt;
{{!}}-{{Hl2}}&lt;br /&gt;
!Value&lt;br /&gt;
!Type&lt;br /&gt;
!Description&lt;br /&gt;
!Default&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{#if:{{{all|&amp;lt;noinclude&amp;gt;*&amp;lt;/noinclude&amp;gt;}}}|&lt;br /&gt;
{{!}} &amp;quot;ALL&amp;quot;&lt;br /&gt;
{{!}} Macro&lt;br /&gt;
{{!}} Used to [[llResetAnimationOverride|reset]] all overrides.&lt;br /&gt;
{{!}} &lt;br /&gt;
}} &lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}}&amp;quot;Crouching&amp;quot;&lt;br /&gt;
{{!}}State&lt;br /&gt;
{{!}}&lt;br /&gt;
{{!}}crouch&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}}&amp;quot;CrouchWalking&amp;quot;&lt;br /&gt;
{{!}}State&lt;br /&gt;
{{!}}&lt;br /&gt;
{{!}}crouchwalk&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}}&amp;quot;Falling Down&amp;quot;&lt;br /&gt;
{{!}}State&lt;br /&gt;
{{!}}&lt;br /&gt;
{{!}}falldown&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}}&amp;quot;Flying&amp;quot;&lt;br /&gt;
{{!}}State&lt;br /&gt;
{{!}}&lt;br /&gt;
{{!}}fly&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}}&amp;quot;FlyingSlow&amp;quot;&lt;br /&gt;
{{!}}State&lt;br /&gt;
{{!}}&lt;br /&gt;
{{!}}flyslow&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}}&amp;quot;Hovering&amp;quot;&lt;br /&gt;
{{!}}State&lt;br /&gt;
{{!}}&lt;br /&gt;
{{!}}hover&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}}&amp;quot;Hovering Down&amp;quot;&lt;br /&gt;
{{!}}State&lt;br /&gt;
{{!}}&lt;br /&gt;
{{!}}hover_down&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}}&amp;quot;Hovering Up&amp;quot;&lt;br /&gt;
{{!}}State&lt;br /&gt;
{{!}}&lt;br /&gt;
{{!}}hover_up&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}}&amp;quot;Jumping&amp;quot;&lt;br /&gt;
{{!}}State&lt;br /&gt;
{{!}}While still in the air during a jump.&lt;br /&gt;
{{!}}jump&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}}&amp;quot;Landing&amp;quot;&lt;br /&gt;
{{!}}Transition&lt;br /&gt;
{{!}}When landing from a jump.&lt;br /&gt;
{{!}}land&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}}&amp;quot;PreJumping&amp;quot;&lt;br /&gt;
{{!}}Transition&lt;br /&gt;
{{!}}At the beginning of a jump.&lt;br /&gt;
{{!}}prejump&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}}&amp;quot;Running&amp;quot;&lt;br /&gt;
{{!}}State&lt;br /&gt;
{{!}}&lt;br /&gt;
{{!}}run&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}}&amp;quot;Sitting&amp;quot;&lt;br /&gt;
{{!}}State&lt;br /&gt;
{{!}}Sitting on an object (and linked to it).&lt;br /&gt;
{{!}}sit&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}}&amp;quot;Sitting on Ground&amp;quot;&lt;br /&gt;
{{!}}State&lt;br /&gt;
{{!}}Sitting, but not linked to an object.{{Footnote|1=&amp;quot;Sit down&amp;quot; on the avatar context menu allows ground sits anywhere: atop the terrain, objects or even in the air.}}&lt;br /&gt;
{{!}}sit_ground_constrained&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}}&amp;quot;Standing&amp;quot;&lt;br /&gt;
{{!}}State&lt;br /&gt;
{{!}}&lt;br /&gt;
{{!}}stand&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}}&amp;quot;Standing Up&amp;quot;&lt;br /&gt;
{{!}}Transition&lt;br /&gt;
{{!}}After falling a great distance. Sometimes referred to as Hard Landing.&lt;br /&gt;
{{!}}standup&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}}&amp;quot;Striding&amp;quot;&lt;br /&gt;
{{!}}State&lt;br /&gt;
{{!}}When the avatar is stuck on the edge of an object or on top of another avatar.&lt;br /&gt;
{{!}}stride&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}}&amp;quot;Soft Landing&amp;quot;&lt;br /&gt;
{{!}}Transition&lt;br /&gt;
{{!}}After falling a small distance.&lt;br /&gt;
{{!}}soft_land&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}}&amp;quot;Taking Off&amp;quot;&lt;br /&gt;
{{!}}State&lt;br /&gt;
{{!}}&lt;br /&gt;
{{!}}hover_up&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}}&amp;quot;Turning Left&amp;quot;&lt;br /&gt;
{{!}}State&lt;br /&gt;
{{!}}&lt;br /&gt;
{{!}}turnleft&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}}&amp;quot;Turning Right&amp;quot;&lt;br /&gt;
{{!}}State&lt;br /&gt;
{{!}}&lt;br /&gt;
{{!}}turnright&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}}&amp;quot;Walking&amp;quot;&lt;br /&gt;
{{!}}State&lt;br /&gt;
{{!}}&lt;br /&gt;
{{!}}walk&lt;br /&gt;
{{!}}}&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Talk:LlGetAnimationOverride&amp;diff=1196970</id>
		<title>Talk:LlGetAnimationOverride</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Talk:LlGetAnimationOverride&amp;diff=1196970"/>
		<updated>2015-07-15T15:17:18Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: Reply&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Default Values ==&lt;br /&gt;
The default values for each of these overrides, that is without any override active, is as follows:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
[14:41] Object: Listing Overridden Animations &amp;lt;br /&amp;gt;&lt;br /&gt;
[14:41] Object: crouch&amp;lt;br /&amp;gt;&lt;br /&gt;
[14:41] Object: crouchwalk&amp;lt;br /&amp;gt;&lt;br /&gt;
[14:41] Object: falldown&amp;lt;br /&amp;gt;&lt;br /&gt;
[14:41] Object: fly&amp;lt;br /&amp;gt;&lt;br /&gt;
[14:41] Object: flyslow&amp;lt;br /&amp;gt;&lt;br /&gt;
[14:41] Object: hover&amp;lt;br /&amp;gt;&lt;br /&gt;
[14:41] Object: hover_down&amp;lt;br /&amp;gt;&lt;br /&gt;
[14:41] Object: hover_up&amp;lt;br /&amp;gt;&lt;br /&gt;
[14:41] Object: jump&amp;lt;br /&amp;gt;&lt;br /&gt;
[14:41] Object: land&amp;lt;br /&amp;gt;&lt;br /&gt;
[14:41] Object: prejump&amp;lt;br /&amp;gt;&lt;br /&gt;
[14:41] Object: run&amp;lt;br /&amp;gt;&lt;br /&gt;
[14:41] Object: sit&amp;lt;br /&amp;gt;&lt;br /&gt;
[14:41] Object: sit_ground_constrained&amp;lt;br /&amp;gt;&lt;br /&gt;
[14:41] Object: stand&amp;lt;br /&amp;gt;&lt;br /&gt;
[14:41] Object: standup&amp;lt;br /&amp;gt;&lt;br /&gt;
[14:41] Object: stride&amp;lt;br /&amp;gt;&lt;br /&gt;
[14:41] Object: soft_land&amp;lt;br /&amp;gt;&lt;br /&gt;
[14:41] Object: hover_up&amp;lt;br /&amp;gt;&lt;br /&gt;
[14:41] Object: turnleft&amp;lt;br /&amp;gt;&lt;br /&gt;
[14:41] Object: turnright&amp;lt;br /&amp;gt;&lt;br /&gt;
[14:41] Object: walk&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
--[[User:Kanashio Resident|Kanashio Resident]] ([[User talk:Kanashio Resident|talk]]) 14:43, 14 July 2015 (PDT)&lt;br /&gt;
&lt;br /&gt;
: Note that the order llOwnerSay outputs lines can not be relied on. Also, empty ones are not output. I&#039;ve modified your script to prefix each line with the corresponding state. Output with no AO follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[08:07:40] Object: Listing Overridden Animations&lt;br /&gt;
[08:07:40] Object: Crouching: crouch&lt;br /&gt;
[08:07:40] Object: CrouchWalking: crouchwalk&lt;br /&gt;
[08:07:40] Object: Falling Down: falldown&lt;br /&gt;
[08:07:40] Object: Flying: fly&lt;br /&gt;
[08:07:40] Object: FlyingSlow: flyslow&lt;br /&gt;
[08:07:40] Object: Hovering: hover&lt;br /&gt;
[08:07:40] Object: Hovering Down: hover_down&lt;br /&gt;
[08:07:40] Object: Hovering Up: hover_up&lt;br /&gt;
[08:07:40] Object: Jumping: jump&lt;br /&gt;
[08:07:40] Object: Landing: land&lt;br /&gt;
[08:07:40] Object: PreJumping: prejump&lt;br /&gt;
[08:07:40] Object: Running: run&lt;br /&gt;
[08:07:40] Object: Sitting: sit&lt;br /&gt;
[08:07:40] Object: Sitting on Ground: sit_ground_constrained&lt;br /&gt;
[08:07:40] Object: Standing: stand&lt;br /&gt;
[08:07:40] Object: Standing Up: standup&lt;br /&gt;
[08:07:40] Object: Striding: stride&lt;br /&gt;
[08:07:40] Object: Soft Landing: soft_land&lt;br /&gt;
[08:07:40] Object: Taking Off: hover_up&lt;br /&gt;
[08:07:40] Object: Turning Left: turnleft&lt;br /&gt;
[08:07:40] Object: Turning Right: turnright&lt;br /&gt;
[08:07:40] Object: Walking: walk&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlGetAnimationOverride&amp;diff=1196969</id>
		<title>LlGetAnimationOverride</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlGetAnimationOverride&amp;diff=1196969"/>
		<updated>2015-07-15T15:15:20Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: Add state names to the output&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL_Function&lt;br /&gt;
|inject-1=&lt;br /&gt;
|inject-2=&lt;br /&gt;
{{LSL_Function/permission|PERMISSION_OVERRIDE_ANIMATIONS|PERMISSION_TRIGGER_ANIMATION}}&lt;br /&gt;
|func_id=?|func_sleep=0.0|func_energy=?&lt;br /&gt;
|func=llGetAnimationOverride|sort=GetAnimationOverride&lt;br /&gt;
|p1_type=string|p1_name=anim_state|p1_desc=animation state&lt;br /&gt;
|func_footnote&lt;br /&gt;
|return_type=string&lt;br /&gt;
|return_text=that is the name of the animation that is being used for the specified animation state ({{LSLPT|anim_state}}). &lt;br /&gt;
|spec&lt;br /&gt;
|caveats&lt;br /&gt;
|constants={{LSL Animation States}}&lt;br /&gt;
|examples=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
//    llGetAnimationOverride Example&lt;br /&gt;
//    A Script to check the animation Stats on&lt;br /&gt;
//  all available overridable animations.&lt;br /&gt;
//    By Kanashio Koroshi and Pedro Oval&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llRequestPermissions(llGetOwner(),&lt;br /&gt;
            PERMISSION_OVERRIDE_ANIMATIONS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    run_time_permissions(integer permissions)&lt;br /&gt;
    {&lt;br /&gt;
        if (permissions &amp;amp; PERMISSION_OVERRIDE_ANIMATIONS)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay(&amp;quot;Listing Overridden Animations&amp;quot;);&lt;br /&gt;
            llOwnerSay(&amp;quot;Crouching: &amp;quot; + llGetAnimationOverride(&amp;quot;Crouching&amp;quot;));&lt;br /&gt;
            llOwnerSay(&amp;quot;CrouchWalking: &amp;quot; + llGetAnimationOverride(&amp;quot;CrouchWalking&amp;quot;));&lt;br /&gt;
            llOwnerSay(&amp;quot;Falling Down: &amp;quot; + llGetAnimationOverride(&amp;quot;Falling Down&amp;quot;));&lt;br /&gt;
            llOwnerSay(&amp;quot;Flying: &amp;quot; + llGetAnimationOverride(&amp;quot;Flying&amp;quot;));&lt;br /&gt;
            llOwnerSay(&amp;quot;FlyingSlow: &amp;quot; + llGetAnimationOverride(&amp;quot;FlyingSlow&amp;quot;));&lt;br /&gt;
            llOwnerSay(&amp;quot;Hovering: &amp;quot; + llGetAnimationOverride(&amp;quot;Hovering&amp;quot;));&lt;br /&gt;
            llOwnerSay(&amp;quot;Hovering Down: &amp;quot; + llGetAnimationOverride(&amp;quot;Hovering Down&amp;quot;));&lt;br /&gt;
            llOwnerSay(&amp;quot;Hovering Up: &amp;quot; + llGetAnimationOverride(&amp;quot;Hovering Up&amp;quot;));&lt;br /&gt;
            llOwnerSay(&amp;quot;Jumping: &amp;quot; + llGetAnimationOverride(&amp;quot;Jumping&amp;quot;));&lt;br /&gt;
            llOwnerSay(&amp;quot;Landing: &amp;quot; + llGetAnimationOverride(&amp;quot;Landing&amp;quot;));&lt;br /&gt;
            llOwnerSay(&amp;quot;PreJumping: &amp;quot; + llGetAnimationOverride(&amp;quot;PreJumping&amp;quot;));&lt;br /&gt;
            llOwnerSay(&amp;quot;Running: &amp;quot; + llGetAnimationOverride(&amp;quot;Running&amp;quot;));&lt;br /&gt;
            llOwnerSay(&amp;quot;Sitting: &amp;quot; + llGetAnimationOverride(&amp;quot;Sitting&amp;quot;));&lt;br /&gt;
            llOwnerSay(&amp;quot;Sitting on Ground: &amp;quot; + llGetAnimationOverride(&amp;quot;Sitting on Ground&amp;quot;));&lt;br /&gt;
            llOwnerSay(&amp;quot;Standing: &amp;quot; + llGetAnimationOverride(&amp;quot;Standing&amp;quot;));&lt;br /&gt;
            llOwnerSay(&amp;quot;Standing Up: &amp;quot; + llGetAnimationOverride(&amp;quot;Standing Up&amp;quot;));&lt;br /&gt;
            llOwnerSay(&amp;quot;Striding: &amp;quot; + llGetAnimationOverride(&amp;quot;Striding&amp;quot;));&lt;br /&gt;
            llOwnerSay(&amp;quot;Soft Landing: &amp;quot; + llGetAnimationOverride(&amp;quot;Soft Landing&amp;quot;));&lt;br /&gt;
            llOwnerSay(&amp;quot;Taking Off: &amp;quot; + llGetAnimationOverride(&amp;quot;Taking Off&amp;quot;));&lt;br /&gt;
            llOwnerSay(&amp;quot;Turning Left: &amp;quot; + llGetAnimationOverride(&amp;quot;Turning Left&amp;quot;));&lt;br /&gt;
            llOwnerSay(&amp;quot;Turning Right: &amp;quot; + llGetAnimationOverride(&amp;quot;Turning Right&amp;quot;));&lt;br /&gt;
            llOwnerSay(&amp;quot;Walking: &amp;quot; + llGetAnimationOverride(&amp;quot;Walking&amp;quot;));&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|helpers&lt;br /&gt;
|also_functions={{LSL DefineRow||[[llSetAnimationOverride]]|}}&lt;br /&gt;
{{LSL DefineRow||[[llResetAnimationOverride]]|}}&lt;br /&gt;
|also_tests&lt;br /&gt;
|also_events&lt;br /&gt;
|also_articles={{LSL DefineRow||[[Internal_Animations]]|lists internal Animations always available}}&lt;br /&gt;
|notes&lt;br /&gt;
|cat1=Animation&lt;br /&gt;
|cat2=Animation/Override&lt;br /&gt;
|cat3&lt;br /&gt;
|cat4&lt;br /&gt;
|history = Date of Release  [[ Release_Notes/Second_Life_Server/13#13.04.12.273874 | 12/04/2013 ]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlGetAnimationOverride&amp;diff=1196968</id>
		<title>LlGetAnimationOverride</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlGetAnimationOverride&amp;diff=1196968"/>
		<updated>2015-07-15T14:49:03Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: Check if the permissions were granted, per best practices&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL_Function&lt;br /&gt;
|inject-1=&lt;br /&gt;
|inject-2=&lt;br /&gt;
{{LSL_Function/permission|PERMISSION_OVERRIDE_ANIMATIONS|PERMISSION_TRIGGER_ANIMATION}}&lt;br /&gt;
|func_id=?|func_sleep=0.0|func_energy=?&lt;br /&gt;
|func=llGetAnimationOverride|sort=GetAnimationOverride&lt;br /&gt;
|p1_type=string|p1_name=anim_state|p1_desc=animation state&lt;br /&gt;
|func_footnote&lt;br /&gt;
|return_type=string&lt;br /&gt;
|return_text=that is the name of the animation that is being used for the specified animation state ({{LSLPT|anim_state}}). &lt;br /&gt;
|spec&lt;br /&gt;
|caveats&lt;br /&gt;
|constants={{LSL Animation States}}&lt;br /&gt;
|examples=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
//    llGetAnimationOverride Example&lt;br /&gt;
//    A Script to check the animation Stats on&lt;br /&gt;
//  all available overridable animations.&lt;br /&gt;
//    By Kanashio Koroshi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llRequestPermissions(llGetOwner(),&lt;br /&gt;
            PERMISSION_OVERRIDE_ANIMATIONS);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    run_time_permissions(integer permissions)&lt;br /&gt;
    {&lt;br /&gt;
        if (permissions &amp;amp; PERMISSION_OVERRIDE_ANIMATIONS)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay(&amp;quot;Listing Overridden Animations&amp;quot;);&lt;br /&gt;
            llOwnerSay(llGetAnimationOverride(&amp;quot;Crouching&amp;quot;));&lt;br /&gt;
            llOwnerSay(llGetAnimationOverride(&amp;quot;CrouchWalking&amp;quot;));&lt;br /&gt;
            llOwnerSay(llGetAnimationOverride(&amp;quot;Falling Down&amp;quot;));&lt;br /&gt;
            llOwnerSay(llGetAnimationOverride(&amp;quot;Flying&amp;quot;));&lt;br /&gt;
            llOwnerSay(llGetAnimationOverride(&amp;quot;FlyingSlow&amp;quot;));&lt;br /&gt;
            llOwnerSay(llGetAnimationOverride(&amp;quot;Hovering&amp;quot;));&lt;br /&gt;
            llOwnerSay(llGetAnimationOverride(&amp;quot;Hovering Down&amp;quot;));&lt;br /&gt;
            llOwnerSay(llGetAnimationOverride(&amp;quot;Hovering Up&amp;quot;));&lt;br /&gt;
            llOwnerSay(llGetAnimationOverride(&amp;quot;Jumping&amp;quot;));&lt;br /&gt;
            llOwnerSay(llGetAnimationOverride(&amp;quot;Landing&amp;quot;));&lt;br /&gt;
            llOwnerSay(llGetAnimationOverride(&amp;quot;PreJumping&amp;quot;));&lt;br /&gt;
            llOwnerSay(llGetAnimationOverride(&amp;quot;Running&amp;quot;));&lt;br /&gt;
            llOwnerSay(llGetAnimationOverride(&amp;quot;Sitting&amp;quot;));&lt;br /&gt;
            llOwnerSay(llGetAnimationOverride(&amp;quot;Sitting on Ground&amp;quot;));&lt;br /&gt;
            llOwnerSay(llGetAnimationOverride(&amp;quot;Standing&amp;quot;));&lt;br /&gt;
            llOwnerSay(llGetAnimationOverride(&amp;quot;Standing Up&amp;quot;));&lt;br /&gt;
            llOwnerSay(llGetAnimationOverride(&amp;quot;Striding&amp;quot;));&lt;br /&gt;
            llOwnerSay(llGetAnimationOverride(&amp;quot;Soft Landing&amp;quot;));&lt;br /&gt;
            llOwnerSay(llGetAnimationOverride(&amp;quot;Taking Off&amp;quot;));&lt;br /&gt;
            llOwnerSay(llGetAnimationOverride(&amp;quot;Turning Left&amp;quot;));&lt;br /&gt;
            llOwnerSay(llGetAnimationOverride(&amp;quot;Turning Right&amp;quot;));&lt;br /&gt;
            llOwnerSay(llGetAnimationOverride(&amp;quot;Walking&amp;quot;));&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|helpers&lt;br /&gt;
|also_functions={{LSL DefineRow||[[llSetAnimationOverride]]|}}&lt;br /&gt;
{{LSL DefineRow||[[llResetAnimationOverride]]|}}&lt;br /&gt;
|also_tests&lt;br /&gt;
|also_events&lt;br /&gt;
|also_articles={{LSL DefineRow||[[Internal_Animations]]|lists internal Animations always available}}&lt;br /&gt;
|notes&lt;br /&gt;
|cat1=Animation&lt;br /&gt;
|cat2=Animation/Override&lt;br /&gt;
|cat3&lt;br /&gt;
|cat4&lt;br /&gt;
|history = Date of Release  [[ Release_Notes/Second_Life_Server/13#13.04.12.273874 | 12/04/2013 ]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Common_compilation_problems&amp;diff=1196829</id>
		<title>Common compilation problems</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Common_compilation_problems&amp;diff=1196829"/>
		<updated>2015-07-01T18:06:49Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: /* C4018: &amp;#039;&amp;lt;&amp;#039; : signed/unsigned mismatch */ &amp;lt;php&amp;gt; to &amp;lt;source&amp;gt; and change language&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{CompileNav}}&lt;br /&gt;
&lt;br /&gt;
= General Problems =&lt;br /&gt;
&lt;br /&gt;
*  Make sure you download not only the source, but the artwork zipfile, and the appropriate zipfile/tarball of libraries for your platform&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Windows = &lt;br /&gt;
&lt;br /&gt;
== Viewer 1.19.1.4 / VS2003 ==&lt;br /&gt;
=== C1083: Cannot open include file: &#039;dxdiag.h&#039; ===&lt;br /&gt;
The DirectX SDK doesn&#039;t automatically insert its include directory into the VS2003 paths. For the June 2008 DirectX SDK release, go to Tools -&amp;gt; Options -&amp;gt; Projects (on left) -&amp;gt; VC++ Directories. On right show directories for Include files, and add:&lt;br /&gt;
* C:\Program Files\Microsoft DirectX SDK (June 2008)\Include&lt;br /&gt;
&lt;br /&gt;
=== C1083: Cannot open include file: &#039;unistd.h&#039; ===&lt;br /&gt;
On Apr 27, 2008 in thread &#039;&#039;[sldev] error while compiling on vc8/9 (unistd.h)&#039;&#039;, SLDev contributor wuhanzymail &amp;lt;wuhanzymail@163.com&amp;gt; recommended the following:&lt;br /&gt;
&lt;br /&gt;
1) right-click project lscript_compile, choose properties, c/c++, Preprocessor, add &#039;&#039;YY_NO_UNISTD_H&#039;&#039; to Preprcessor Definitions.&lt;br /&gt;
&lt;br /&gt;
2) in lex_yy.cpp, line 5915 change:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;           #ifndef __cplusplus&lt;br /&gt;
           extern int isatty (int );&lt;br /&gt;
           #endif&amp;lt;/source&amp;gt;&lt;br /&gt;
to:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;           #ifndef YY_NEVER_INTERACTIVE&lt;br /&gt;
           extern int isatty (int );&lt;br /&gt;
           #endif&amp;lt;/source&amp;gt;&lt;br /&gt;
3) still in lex_yy.cpp, line 5943 change:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;          b-&amp;gt;yy_is_interactive = file ? (isatty( fileno(file) ) &amp;gt; 0) : 0;&amp;lt;/source&amp;gt;&lt;br /&gt;
to:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;          #if YY_NEVER_INTERACTIVE&lt;br /&gt;
              b-&amp;gt;yy_is_interactive = 0;&lt;br /&gt;
          #else&lt;br /&gt;
              b-&amp;gt;yy_is_interactive = file ? (isatty( fileno(file) ) &amp;gt; 0) : 0;&lt;br /&gt;
          #endif&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C4018: &#039;&amp;lt;&#039; : signed/unsigned mismatch ===&lt;br /&gt;
On Apr 30, 2008 in thread &#039;&#039;[sldev] cygwin flex lscript_compile workaround&#039;&#039;, SLDev contributor Steve Linden recommended the following:&lt;br /&gt;
&lt;br /&gt;
I&#039;m not sure whether this has already been addressed here, but we &lt;br /&gt;
discovered a problem with the latest version of Cygwin flex and &lt;br /&gt;
lscript_compile and I thought I would share the workaround. We&#039;ve &lt;br /&gt;
committed the workaround to our release-candidate branche so it should &lt;br /&gt;
be in an upcoming source drop as well.&lt;br /&gt;
&lt;br /&gt;
1. Add &#039;&#039;YY_NO_UNISTD_H&#039;&#039; to the list of Preprocessor Definitions in the &lt;br /&gt;
lscript_compile project file.&lt;br /&gt;
&lt;br /&gt;
2. Apply the following patch it indra.l:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;Index: indra.l&lt;br /&gt;
===================================================================&lt;br /&gt;
--- indra.l    (revision 86342)&lt;br /&gt;
+++ indra.l    (revision 86343)&lt;br /&gt;
@@ -12,6 +12,7 @@&lt;br /&gt;
 #include &amp;quot;linden_common.h&amp;quot;&lt;br /&gt;
 // Deal with the fact that lex/yacc generates unreachable code&lt;br /&gt;
 #ifdef LL_WINDOWS&lt;br /&gt;
+#pragma warning (disable : 4018) // warning C4018: signed/unsigned mismatch&lt;br /&gt;
 #pragma warning (disable : 4702) // warning C4702: unreachable code&lt;br /&gt;
 #endif    //    LL_WINDOWS&lt;br /&gt;
 #include &amp;quot;llmath.h&amp;quot;&lt;br /&gt;
@@ -44,7 +45,10 @@&lt;br /&gt;
 &lt;br /&gt;
 #define YYLMAX 16384&lt;br /&gt;
 #define YY_NEVER_INTERACTIVE 1 /* stops flex from calling isatty() */&lt;br /&gt;
-&lt;br /&gt;
+#ifdef LL_WINDOWS&lt;br /&gt;
+#define isatty(x) 0 /* hack for bug in cygwin flex 2.5.35 */&lt;br /&gt;
+#endif&lt;br /&gt;
+&lt;br /&gt;
 #ifdef ECHO&lt;br /&gt;
 #undef ECHO&lt;br /&gt;
 #endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [...] error result returned from &#039;link.exe&#039; ===&lt;br /&gt;
By checking the Output window (View menu -&amp;gt; Other Windows), this shows up as an error saying: &#039;&#039;link: extra operand `/NOLOGO&#039; &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As reported by Brad Linden, this is caused by having the compiler executable directories in the wrong order, with the Cygwin directory path listed above the Visual Studio paths. This causes the Cygwin linker to be used instead of Visual Studio&#039;s linker.&lt;br /&gt;
&lt;br /&gt;
Go to Tools -&amp;gt; Options -&amp;gt; Projects -&amp;gt; VC++ Directories, show directories for Executables, and move &amp;quot;C:\cygwin\bin&amp;quot; to the bottom of the list.&lt;br /&gt;
&lt;br /&gt;
== Unresolved external symbol _CLSID_DxDiagProvider/_IID_IDxDiagProvider ==&lt;br /&gt;
* &#039;&#039;newview error LNK2001: unresolved external symbol _CLSID_DxDiagProvider&#039;&#039;&lt;br /&gt;
* &#039;&#039;newview error LNK2001: unresolved external symbol _IID_IDxDiagProvider&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These errors reportedly occur with MSVC 2003 and certain versions of the DirectX SDK.  To workaround, edit lldxhardware.cpp and replace the following (line 35):&lt;br /&gt;
&lt;br /&gt;
     #include &amp;lt;dxdiag.h&amp;gt;&lt;br /&gt;
with...&lt;br /&gt;
     #define INITGUID&lt;br /&gt;
     #include &amp;lt;dxdiag.h&amp;gt;&lt;br /&gt;
     #undef INITGUID&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cannot open input file &#039;dxguid.lib&#039; ==&lt;br /&gt;
* &#039;&#039;fatal error LNK1181: cannot open input file &#039;dxguid.lib&#039; in ...&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you are using a fairly recent DirectX SDK (&amp;quot;December 2006&amp;quot; or newer), your VC++ Libraries Directory may be wrong because the SDK&#039;s lib folder now has 2 sub-folders for x64 and x86.  Try changing the path from &#039;&#039;C:\Program Files\Microsoft DirectX SDK (December 2006)\Lib&#039;&#039; to &#039;&#039;C:\Program Files\Microsoft DirectX SDK (December 2006)\&#039;&#039; &#039;&#039;&#039;Lib\x86&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
== Cannot open input file &#039;dxerr8.lib&#039; ==&lt;br /&gt;
* &#039;&#039;fatal error LNK1104: cannot open file &#039;dxerr8.lib&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you are using the most recent DirectX SDK (&amp;quot;November 2007&amp;quot;), the file dxerr8.lib does no longer exist. To fix this, you&#039;ll need to change the newview project to include &#039;dxerr9.lib&#039; instead. To do this, right-lick newview &amp;gt; Configuration Properties &amp;gt; Linker &amp;gt; Input, click Additional Dependencies on the right to show a button labeled &amp;quot;...&amp;quot; on it at the very right on the line, then click the ... button. Scroll down the list to find &#039;dxerr8.lib&#039;. Rewrite it to &#039;dxerr9.lib&#039;. Remember to do this for both the ReleaseForDownload and the ReleaseNoOpt Configurations.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== A tool returned an error code from &amp;quot;Building ytab.cpp&amp;quot; ==&lt;br /&gt;
* &#039;&#039;lscript_compile_fb error PRJ0019: A tool returned an error code from &amp;quot;Building ytab.cpp&amp;quot; &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
One possible reason for this is that Visual Studio does not know where cygwin/bin is, especially if this is accompanied by an error relating to bison.exe being an invalid command.  Even if the directory for cygwin is in the environment variable PATH, Visual Studio maintains its own separate copy which does not seem to be automatically synchronized after the initial installation.&lt;br /&gt;
&lt;br /&gt;
For Visual Studio .NET 2003, go to Tools &amp;gt; Options &amp;gt; Projects &amp;gt; VC++ Directories.  In the &amp;quot;show directories for&amp;quot; dropdown, choose &amp;quot;Executable files&amp;quot;.  Make sure that your cygwin (default C:\cygwin\bin) and ActivePython (default C:\Python25) directories are listed.&lt;br /&gt;
&lt;br /&gt;
== Cannot open include file: &#039;ytab.h&#039;: No such file or directory ==&lt;br /&gt;
* &#039;&#039;indra.l (20) : fatal error C1083: Cannot open include file: &#039;ytab.h&#039;: No such file or directory.&#039;&#039;&lt;br /&gt;
Workaround: Manually copy &amp;quot;linden\indra\lscript\lscript_compile\ytab.hpp&amp;quot; to &amp;quot;linden\indra\lscript\lscript_compile\ytab.h&amp;quot; and build again. &lt;br /&gt;
&lt;br /&gt;
Note: The underlying issue is that in indra.y there is a postbuild step which should do this automatically, but which is missing in some configurations (e.g. in Debug builds).&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
== Cannot open include file: &#039;png.h&#039;: No such file or directory ==&lt;br /&gt;
* &#039;&#039;imagepng.cpp : fatal error C1083: Cannot open include file: &#039;libpng12/png.h&#039;: No such file or directory.&#039;&#039;&lt;br /&gt;
There are a couple of files missing since the 1.17. distribution.  You can either get the missing files from the internet (from the libpng and zlib projects) or download a set with just the missing files from [http://www.blueflash.cc/users/nicholaz/~libs here] (see the readme.txt inside the png archive there).&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
== Cannot open include file: &#039;glh/glh_linear.h&#039; or &#039;glh/glh_convenience.h&#039; ==&lt;br /&gt;
These files are currently missing from Linden Windlight distributions.  See [https://jira.secondlife.com/browse/VWR-3415 JIRA VWR-3415] or grab a copy from [http://www.blueflash.cc/users/nicholaz/~libs here] and put the files into a folder named linden/libraries/include/glh.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Errors relating to &amp;quot;template_verifier.py&amp;quot; ==&lt;br /&gt;
With version 1.18 a template verifier script written in Python is used to ensure the message template is correct.  In some distributions the file was missing.  You will also get an error if you have skipped the Python install.  In both cases it is safe to hack the prebuild.bat file in the newview folder as described on the JIRA [http://jira.secondlife.com/browse/VWR-1267 VWR-1267]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Missing resources ==&lt;br /&gt;
* &#039;&#039;.\res\newViewRes.rc(64) : error RC2135 : file not found: ll_icon.ico&#039;&#039;&lt;br /&gt;
Some releases have missing files, which were reported to be last seen in the &#039;&#039;&#039;1.14.0.1&#039;&#039;&#039; release.&lt;br /&gt;
* Go to the [[source downloads]] page and grab the [[http://secondlife.com/developers/opensource/downloads/2007/04/slviewer-src-1.14.0.1.zip &#039;&#039;&#039;1.14.0.1&#039;&#039;&#039; viewer]] sources.&lt;br /&gt;
* Explore the archive to &amp;quot;linden/indra/newview/res&amp;quot; folder and extract content to your &amp;quot;linden/indra/newview/res&amp;quot; folder into current revision.&lt;br /&gt;
Missing folder in recent release, &amp;quot;&#039;&#039;&#039;1.17.0.12&#039;&#039;&#039;&amp;quot; which causes the SecondLife to hang while loading into the world.&lt;br /&gt;
* Go to the previous source and copy the missing folder, &amp;quot;Character&amp;quot; and place it into the &amp;quot;newview&amp;quot; folder&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
== Error code from &amp;quot;Copying message template&amp;quot; ==&lt;br /&gt;
* &#039;&#039;newview error PRJ0019: A tool returned an error code from &amp;quot;Copying message template&amp;quot;&#039;&#039;&lt;br /&gt;
This is caused by the script trying to do a copy command, but the source path isn&#039;t in quotes.  Open up newview.vcproj in notepad, and near the bottom there are 4 line that say:&lt;br /&gt;
     CommandLine=&amp;quot;copy $(InputPath) .\app_settings\message_template.msg&lt;br /&gt;
replace them with&lt;br /&gt;
     CommandLine=&amp;quot;copy &amp;amp;amp;quot;$(InputPath)&amp;amp;amp;quot; .\app_settings\message_template.msg&lt;br /&gt;
The source and destination paths on line 158 may also require wrapping in quotes.  In which case:&lt;br /&gt;
     CommandLine=&amp;quot;copy $(TargetDir)\$(TargetFileName) $(ProjectDir)&lt;br /&gt;
should become:&lt;br /&gt;
     CommandLine=&amp;quot;copy &amp;amp;amp;quot;$(TargetDir)\$(TargetFileName)&amp;amp;amp;quot; &amp;amp;amp;quot;$(ProjectDir)&amp;amp;amp;quot;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
== Can not find library ll*.lib ==&lt;br /&gt;
If you get a compile error for missing libraries with names of the projects (lscript_compile.lib, llaudio.lib, llcharacter.lib, etc.) go to newview &amp;gt; Properties &amp;gt; Linker &amp;gt; Input and remove these from the list of input libraries (they will be linked through the dependencies and should not be in the list).&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cannot open include file: &#039;windows.h&#039; ==&lt;br /&gt;
If you run into this problem:&lt;br /&gt;
 ..\..\..\boost/regex/v4/fileiter.hpp(44) : fatal error C1083: Cannot open include file: &#039;windows.h&#039;: No such file or directory&lt;br /&gt;
Fix it with this: (thanks Fairlight!)&lt;br /&gt;
 set INCLUDE=C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include;%INCLUDE%&lt;br /&gt;
 set LIB=C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib;%LIB%&lt;br /&gt;
You might need to edit the above path to refer to your particular platform SDK.  If you don&#039;t have the Microsoft Windows Platform SDK installed, then you can download it for free from Microsoft.  It is version specific and can be tricky to find on their website.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re having problems with windows.h in Visual Studio Express 2005, check out this forum post:&lt;br /&gt;
[http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1995837&amp;amp;SiteID=1 MSDN Forum Post]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Unresolved external symbol &amp;quot;int __cdecl lscript_compile&amp;quot; (VS2005) ==&lt;br /&gt;
* &#039;&#039;llcompilequeue.obj : error LNK2019: unresolved external symbol &amp;quot;int __cdecl lscript_compile(char const *,char const *,char const *,int)&amp;quot; (?lscript_compile@@YAHPBD00H@Z) referenced in function &amp;quot;protected: void __thiscall LLFloaterCompileQueue::compile(char const *,class LLUUID const &amp;amp;)&amp;quot; (?compile@LLFloaterCompileQueue@@IAEXPBDABVLLUUID@@@Z)&#039;&#039;&lt;br /&gt;
* &#039;&#039;llpreviewscript.obj : error LNK2001: unresolved external symbol &amp;quot;int __cdecl lscript_compile(char const *,char const *,char const *,int)&amp;quot; (?lscript_compile@@YAHPBD00H@Z)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is not entirely clear, but there seems to be a problem with VS2005 if projects are unloaded while being in the dependency tree.  I have seen this error while I had win_crash_logger and win_updater unloaded from the project tree and the problem went away when I loaded them back and excluded them from the newview dependency first.&lt;br /&gt;
&lt;br /&gt;
Also make sure that in newview, properties, linker, input, input libraries, no libraries named ll*.lib and lscript_compile.lib are listed there (remove them if you find them).&lt;br /&gt;
&lt;br /&gt;
Also be sure that your error does not come from previously in the log: like the cgywin component bison not being found. For MSVS2005 Express, you may need to go to tools&amp;gt;options&amp;gt;Projects and Solutions&amp;gt;VC++ Directories&amp;gt;Executable files and add the directory for cgywin. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Unresolved external symbol __invalid_parameter_noinfo (VS2005) ==&lt;br /&gt;
* &#039;&#039;llmozlib-vc80.lib(llembeddedbrowserwindow.obj) : error LNK2019: unresolved external symbol __invalid_parameter_noinfo referenced&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You are most likely trying a debug build under VS2005.  For debug builds, see the compile instruction section on [[finding_leaks]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cannot open include file: &#039;ares.h&#039; ==&lt;br /&gt;
download src from http://daniel.haxx.se/projects/c-ares/&lt;br /&gt;
&lt;br /&gt;
compile c-ares-1.4.0/vc/areslib&lt;br /&gt;
&lt;br /&gt;
copy c-ares-1.4.0/vc/areslib/Release/areslib.lib to linden/libraries/i686-win32/lib_release and to lib_debug&lt;br /&gt;
&lt;br /&gt;
copy c-ares-1.4.0/*.h to linden/libraries/i686-win32/include/ares&lt;br /&gt;
&lt;br /&gt;
===FMOD===&lt;br /&gt;
FMOD headers and libs need to be copied into the viewer build directory BUT on Windows the manifests are not currently moving the libs to the correct location post build so the application will fail to run, to resolve copy fmod.dll to indra/build-vc71/newview/debug and indra/build-vc71/newview/relwithdebinfo and indra/build-vc71/newview/release&lt;br /&gt;
&lt;br /&gt;
===Boost and VS 2008===&lt;br /&gt;
If you use Visual Studio C++ 2008 (VC90), you may find that the Boost library will lock up solid and the viewer will not tun consuming 50-100% of CPU doing nothing. The only solutions are to use Visual Studio 2005 OR to get a newer version/rebuild boost with Visual Studio 2008.&lt;br /&gt;
&lt;br /&gt;
This problem is being worked on. Look here for updates: [https://jira.secondlife.com/browse/VWR-9541 VWR-9541]&lt;br /&gt;
&lt;br /&gt;
===Express editions of Visual C++===&lt;br /&gt;
Express editions do not have some of the extra features that VSTool.exe requires, VSTool is a little application that sets a few default project options, like which project is the startup and which build configuration to use.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===LLKDU===&lt;br /&gt;
This is not present in the automated libs download but is required at least on windows by the copy_win_scrips script. The file is not actually needed for the viewer to run (if present it will be used for jpeg2000 decoding in preference to Openjpeg. The solution is to remove the lines from newview/copy_win_scripts that reference llkdu and this should then allow this custom build step to run without issue&lt;br /&gt;
&lt;br /&gt;
=== [...]/CMakeDetermineCompilerABI_C.bin cannot be read. ===&lt;br /&gt;
Occurs on Windows 7, make sure your running the cmd shell (or whatever your using to run the &amp;quot;python develop.py&amp;quot;) with Administrator privileges.&lt;br /&gt;
&lt;br /&gt;
== fatal error C1060: compiler is out of heap space ==&lt;br /&gt;
If you are not using Incredibuild and have precompiled headers disabled, you may encounter this error.&lt;br /&gt;
Try enabling building with precompiled headers:&lt;br /&gt;
&amp;lt;pre&amp;gt;autobuild configure -c [configuration] -- -DUSE_PRECOMPILED_HEADERS:BOOL=ON&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Other (older) notes ==&lt;br /&gt;
* Mozilla is not compatible with visual studio 2005, so we have not migrated the codebase, so we do not know if it works. &lt;br /&gt;
&lt;br /&gt;
* Added my errors at [[User:Adam_Zaius/MSVS2005 Errors]] [[User:Adam Zaius|Adam Zaius]] 09:40, 8 January 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
* To minimize the number of warnings for now: in C/C++-Preprocessor add &#039;;_CRT_SECURE_NO_DEPRECATE&#039; to the Preprocessor Definitions, that will supress deprecation warnings --[[User:Artm Udal|Artm Udal]] 12:42, 8 January 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Mac OS X =&lt;br /&gt;
&lt;br /&gt;
Getting:&lt;br /&gt;
&lt;br /&gt;
*/linden/indra/newview/../llwindow/llglheaders.h:377:31: error: GL/glh_extensions.h: No such file or directory&lt;br /&gt;
** This means you didn&#039;t [[Compiling the viewer (Mac OS X)#Viewer Source, Libraries, and Artwork|merge the libraries]] right.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Linux =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== libGL ===&lt;br /&gt;
&lt;br /&gt;
Sometimes the provide libGL.a can cause issues.  To avoid linker errors, you may need to remove indra/libraries/i686-linux/release/libGL.a and indra/libraries/i686-linux/debug/libGL.a&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Packaging errors ===&lt;br /&gt;
&lt;br /&gt;
The final packaging step may fail with errors about the manifest if you are not using the &amp;lt;i&amp;gt;slviewer-linux-libs&amp;lt;/i&amp;gt; bundle; in this case, if you still wish to end up with an end-user viewer package incorporating your own libraries, you can edit the manifest file found at &amp;lt;b&amp;gt;indra/newview/viewer_manifest.py&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Various Compilation problems ===&lt;br /&gt;
&lt;br /&gt;
====Various missing libraries====&lt;br /&gt;
&amp;lt;pre&amp;gt;g++-3.4 -o linux_crash_logger/linux-crash-logger-i686-bin-globalsyms --no-keep-memory --reduce-memory-overheads /tmp/paul/home/paul/builds/secondlife/src/linden/indra/i686-linux-client-release/llcrashlogger/llcrashlogger.o /tmp/paul/home/paul/builds/secondlife/src/linden/indra/i686-linux-client-release/linux_crash_logger/linux_crash_logger.o /tmp/paul/home/paul/builds/secondlife/src/linden/indra/i686-linux-client-release/linux_crash_logger/llcrashloggerlinux.o -Llib_release_client/i686-linux -L/home/paul/builds/secondlife/src/linden/libraries/i686-linux/lib_release_client -lllui -lllxml -lllmessage -lllvfs -lllmath -lllcommon -lcurl -lssl -lcrypto -laprutil-1 -lapr-1 -lcares -lexpat -ldb-4.2 -lgtk-x11-2.0&lt;br /&gt;
/usr/bin/ld: skipping incompatible /home/paul/builds/secondlife/src/linden/libraries/i686-linux/lib_release_client/libcurl.a when searching for -lcurl&lt;br /&gt;
/usr/bin/ld: skipping incompatible /home/paul/builds/secondlife/src/linden/libraries/i686-linux/lib_release_client/libssl.so when searching for -lssl&lt;br /&gt;
/usr/bin/ld: skipping incompatible /home/paul/builds/secondlife/src/linden/libraries/i686-linux/lib_release_client/libcrypto.so when searching for -lcrypto&lt;br /&gt;
/usr/bin/ld: skipping incompatible /home/paul/builds/secondlife/src/linden/libraries/i686-linux/lib_release_client/libaprutil-1.so when searching for -laprutil-1&lt;br /&gt;
/usr/bin/ld: skipping incompatible /home/paul/builds/secondlife/src/linden/libraries/i686-linux/lib_release_client/libapr-1.so when searching for -lapr-1&lt;br /&gt;
/usr/bin/ld: skipping incompatible /home/paul/builds/secondlife/src/linden/libraries/i686-linux/lib_release_client/libcares.a when searching for -lcares&lt;br /&gt;
/usr/bin/ld: skipping incompatible /home/paul/builds/secondlife/src/linden/libraries/i686-linux/lib_release_client/libexpat.so when searching for -lexpat&lt;br /&gt;
/usr/bin/ld: skipping incompatible /home/paul/builds/secondlife/src/linden/libraries/i686-linux/lib_release_client/libdb-4.2.so when searching for -ldb-4.2&lt;br /&gt;
/usr/bin/ld: cannot find -ldb-4.2&lt;br /&gt;
collect2: ld returned 1 exit status&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 [paul@myhost secondlife]$ pacman -Q db&lt;br /&gt;
 db 4.6.21-2&lt;br /&gt;
&lt;br /&gt;
 [paul@myhost secondlife]$ uname -a&lt;br /&gt;
 Linux myhost 2.6.23-ARCH #1 SMP PREEMPT Tue Jan 15 07:17:51 CET 2008 x86_64 Intel(R) Celeron(R) CPU 2.66GHz GenuineIntel GNU/Linux&lt;br /&gt;
&lt;br /&gt;
And using:&amp;lt;pre&amp;gt;&lt;br /&gt;
source=(&#039;secondlife.desktop&#039; &#039;secondlife.install&#039; &#039;secondlife.launcher&#039; \&lt;br /&gt;
&amp;quot;http://secondlife.com/developers/opensource/downloads/2008/01/slviewer-src-RC-${pkgver}.tar.gz&amp;quot; \&lt;br /&gt;
&#039;http://secondlife.com/developers/opensource/downloads/2007/12/slviewer-artwork-RC-1.18.6.2.zip&#039; \&lt;br /&gt;
&#039;http://secondlife.com/developers/opensource/downloads/2007/12/slviewer-linux-libs-RC-1.18.6.2.tar.gz&#039; \&lt;br /&gt;
&#039;http://www.fmod.org/index.php/release/version/fmodapi375linux.tar.gz&#039; \&lt;br /&gt;
&#039;http://secondlife.com/developers/opensource/downloads/2007/12/llmozlib-src-20071221.tar.gz&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hum ok, I was trying to use:&lt;br /&gt;
 scons DISTCC=no BTARGET=client BUILD=release MOZLIB=yes&lt;br /&gt;
&lt;br /&gt;
I&#039;ll retry with:&lt;br /&gt;
 scons BUILD=release ARCH=x86_64 BTARGET=client DISTCC=no MOZLIB=yes FMOD=yes GSTREAMER=yes STANDALONE=yes&lt;br /&gt;
(Sconstruct says that with STANDALONE=yes -db-4.2 will not be used)&lt;br /&gt;
&lt;br /&gt;
But at the beginning I get:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
scons: Reading SConscript files ...&lt;br /&gt;
Building client 1.18.6.2 on x86_64-linux (release)&lt;br /&gt;
No CCACHE_DIR set.&lt;br /&gt;
&lt;br /&gt;
scons: warning: Two different environments were specified for target /tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llcrashlogger/llcrashlogger.o&amp;gt;,&lt;br /&gt;
	but they appear to have the same action: $CXX -o $TARGET -c $CXXFLAGS $_CCCOMCOM $SOURCES&lt;br /&gt;
File &amp;quot;/home/paul/builds/secondlife/src/linden/indra/SConstruct&amp;quot;, line 568, in create_executable&lt;br /&gt;
scons: done reading SConscript files.&lt;br /&gt;
scons: Building targets ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
well, the new scons line give different problem:&lt;br /&gt;
&amp;lt;pre&amp;gt;g++ -o /tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llmath/llquaternion.o -c -g -pipe -Wall -Wno-reorder -Wno-trigraphs -Wno-sign-compare -Werror -fexceptions -pthread -D_REENTRANT -fno-math-errno -fsigned-char -fno-strict-aliasing -falign-loops=16 -ffast-math -O2 -D_FORTIFY_SOURCE=2 -DLL_STANDALONE -DLL_MESA_HEADLESS=0 -DLL_MESA=0 -DLL_LINUX=1 -DAPPID=secondlife -DLL_SDL=1 -DLL_FMOD=0 -DLL_X11=1 -DLL_GTK=1 -DLL_LIBXUL_ENABLED=1 -DLL_GSTREAMER_ENABLED=1 -DNDEBUG -DLL_RELEASE=1 -Illcommon -Illmath -Illwindow -Illaudio -Illcharacter -Illcrashlogger -Illdatabase -Illhavok -Illimage -Illinventory -Illmedia -Illmessage -Illprimitive -Illrender -Illscene -Illui -Illvfs -Illwindow -Illxml -Ilscript -Ilscript/lscript_compile -I/home/paul/builds/secondlife/src/linden/libraries/include -I/home/paul/builds/secondlife/src/linden/libraries/include/havok -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include -I/usr/include/atk-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/SDL -I/usr/include/apr-1 -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/gstreamer-0.10 -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/glib-2.0 -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/glib-2.0/include -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/libxml2 /tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llmath/llquaternion.cpp&lt;br /&gt;
cc1plus: warnings being treated as errors&lt;br /&gt;
/tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llmath/llquaternion.cpp: In function &#039;const char* OrderToString(LLQuaternion::Order)&#039;:&lt;br /&gt;
/tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llmath/llquaternion.cpp:701: warning: deprecated conversion from string constant to &#039;char*&#039;&lt;br /&gt;
/tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llmath/llquaternion.cpp:704: warning: deprecated conversion from string constant to &#039;char*&#039;&lt;br /&gt;
/tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llmath/llquaternion.cpp:707: warning: deprecated conversion from string constant to &#039;char*&#039;&lt;br /&gt;
/tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llmath/llquaternion.cpp:710: warning: deprecated conversion from string constant to &#039;char*&#039;&lt;br /&gt;
/tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llmath/llquaternion.cpp:713: warning: deprecated conversion from string constant to &#039;char*&#039;&lt;br /&gt;
/tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llmath/llquaternion.cpp:716: warning: deprecated conversion from string constant to &#039;char*&#039;&lt;br /&gt;
scons: *** [/tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llmath/llquaternion.o] Error 1&lt;br /&gt;
scons: building terminated because of errors.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well, STANDALONE=yes make it use g++ rather than g++-3.4, so I decided to remove it, keeping&lt;br /&gt;
ARCH=X86_64 and others, but I get:&lt;br /&gt;
&amp;lt;pre&amp;gt;ranlib lib_release_client/x86_64-linux/libllprimitive.a&lt;br /&gt;
g++-3.4 -o /tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llrender/llfont.o -c -g -pipe -Wall -Wno-reorder -Wno-trigraphs -Wno-sign-compare -Werror -fexceptions -pthread -D_REENTRANT -fno-math-errno -fsigned-char -fno-strict-aliasing -falign-loops=16 -ffast-math -O2 -D_FORTIFY_SOURCE=2 -DLL_MESA_HEADLESS=0 -DLL_MESA=0 -DLL_LINUX=1 -DAPPID=secondlife -DLL_SDL=1 -DLL_FMOD=0 -DLL_X11=1 -DLL_GTK=1 -DLL_LIBXUL_ENABLED=1 -DLL_GSTREAMER_ENABLED=1 -DNDEBUG -DLL_RELEASE=1 -Illcommon -Illmath -Illwindow -Illaudio -Illcharacter -Illcrashlogger -Illdatabase -Illhavok -Illimage -Illinventory -Illmedia -Illmessage -Illprimitive -Illrender -Illscene -Illui -Illvfs -Illwindow -Illxml -Ilscript -Ilscript/lscript_compile -I/home/paul/builds/secondlife/src/linden/libraries/include -I/home/paul/builds/secondlife/src/linden/libraries/include/havok -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/ELFIO -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/atk-1.0 -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/glib-2.0 -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/gtk-2.0 -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/llfreetype2 -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/pango-1.0 -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/gstreamer-0.10 -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/glib-2.0 -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/glib-2.0/include -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/libxml2 /tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llrender/llfont.cpp&lt;br /&gt;
/tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llrender/llfont.cpp:41:44: llfreetype2/freetype/ft2build.h: No such file or directory&lt;br /&gt;
/tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llrender/llfont.cpp:56: error: `FT_Render_Mode&#039; does not name a type&lt;br /&gt;
/tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llrender/llfont.cpp:60: error: `FT_Library&#039; does not name a type&lt;br /&gt;
/tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llrender/llfont.cpp: In constructor `LLFontManager::LLFontManager()&#039;:&lt;br /&gt;
/tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llrender/llfont.cpp:78: error: `gFTLibrary&#039; was not declared in this scope&lt;br /&gt;
... [many more errors]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
oh well, SConstruct says I need: cairo glib-2.0 atk gmobile-2.0 gdk-2.0 gdk-pixbuf-2.0 pango pangoft2 pangox pangoxft gtk+-2.0 sdl vorbis vorbisenc vorbisfile&lt;br /&gt;
&lt;br /&gt;
Maybe this is pangoft2 that is missing.&lt;br /&gt;
&lt;br /&gt;
* This part is probably not relevant anymore --[[USER:Thickbrick Sleaford|Thickbrick]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Unable to initialize communications&amp;quot;====&lt;br /&gt;
* If the viewer just displays the error message &amp;quot; Unable to initialize communications&amp;quot; and exits, it can&#039;t find message_template.msg. You did remember to copy it over, right?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Blino&#039;s SL build/linking patches for &#039;&#039;&#039;gcc4&#039;&#039;&#039;====&lt;br /&gt;
http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/secondlife/current/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====objcopy: &amp;lt;b&amp;gt;&#039;newview/linux_tools/exposed-symbols.txt&#039;&amp;lt;/b&amp;gt;: No such file====&lt;br /&gt;
* Tofu says... &#039;This is an omission from our manifest which I&#039;ll fix.  Meanwhile it&#039;s a safe fix to create an empty file with that name.&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Something like: &amp;lt;b&amp;gt;/usr/bin/ld: cannot find -lz&amp;lt;/b&amp;gt;====&lt;br /&gt;
* Nadia says: Install the zlib development headers. (Ubuntu package zlib1g-dev, Red Hat zlib-devel.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Something like: indra.y.cpp:17: &amp;lt;b&amp;gt;error: previous declaration of `int yyparse()&#039;&amp;lt;/b&amp;gt;====&lt;br /&gt;
* Tofu says... &#039;This appears to be a problem with some versions of flex/bison.  A resident reports success when comment out the &amp;lt;i&amp;gt;#ifdef __cplusplus&amp;lt;/i&amp;gt; lines in lscript/lscript_compile/indra.y&#039;&lt;br /&gt;
* Nadia says: install the zlib development headers first and try recompiling. Commenting out those lines results in a error indra.l:666: &amp;lt;b&amp;gt;undefined&amp;lt;/b&amp;gt;&lt;br /&gt;
* Abi says: I forgot to install bison.  Once I did that, problem solved.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Linking failures (&amp;quot;script not found&amp;quot;) due to spaces in the LINKFLAGS variable?====&lt;br /&gt;
* I saw a [http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4665538 report], and modified the SConstruct file to drop the trailing arguments (and spaces) in LINKFLAGS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====&#039;&#039;cp: target `SecondLife_i686_1_13_1_7/app_settings/*’ is not a directory&#039;&#039;====&lt;br /&gt;
Building [https://lists.secondlife.com/pipermail/sldev/2007-January/000091.html 20070112a] using &#039;&#039;BUILD=releasefordownload&#039;&#039; I get many &#039;&#039;[: 89: ==: unexpected operator&#039;&#039; errors; &#039;&#039;cp: target `SecondLife_i686_1_13_1_7/app_settings/*’ is not a directory&#039;&#039; error, and same thing for character, fonts, help, skins, res-sdl; &#039;&#039;[: 111: ==: unexpected operator, [: 120: SecondLife_i686_1_13_1_7.tar.bz2: unexpected operator&#039;&#039;. I can succesfully run the client from the source tree.&lt;br /&gt;
* i think this has been fixed --[[User:Signore Iredell|Signore Iredell]] 06:09, 9 June 2007 (PDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====`[&#039;.../lscript/lscript_compile/indra.l.cpp&#039;]&#039;: Don&#039;t know how to build a file with suffix `.l&#039;====&lt;br /&gt;
scons: *** While building `[&#039;.../linden/indra/i686-linux-client-release/lscript/lscript_compile/indra.l.cpp&#039;]&#039;: Don&#039;t know how to build a file with suffix `.l&#039;.&lt;br /&gt;
* You probably don&#039;t have all the dependencies installed (I had the same problem). Check that you have flex and bison. --[[User:Random73 Janus|Random73 Janus]] 07:43, 16 May 2007 (PDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====`glActiveTextureARB&#039; was not declared in this scope====&lt;br /&gt;
Something like: linden/indra/i686-linux-client-release/llrender/llimagegl.cpp:122: &amp;lt;b&amp;gt;error: `glActiveTextureARB&#039; was not declared in this scope&amp;lt;/b&amp;gt;	 &lt;br /&gt;
* Tofu says... &#039;You&#039;ll need to install OpenGL headers if you don&#039;t already have them: gl.h, glext.h, glu.h (The ones from &#039;mesa&#039; should work)	 &lt;br /&gt;
* two residents report good luck on Gentoo after doing &#039;eselect opengl set xorg-x11&#039; (&amp;lt;b&amp;gt;but note!!&amp;lt;/b&amp;gt; You must know what you&#039;re doing; this may change your default system OpenGL drivers, and you will probably want to change them back again after the compile, e.g. &#039;eselect opengl set nvidia&#039;)&#039;&lt;br /&gt;
* Note that the above xorg-x11/nvidia issue is addressed in [http://jira.secondlife.com/browse/VWR-9557 VWR-9557] which includes patches!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Building Shared Library ELFIO====&lt;br /&gt;
 Building Shared Library ELFIO [[Compiling_the_viewer_%28Linux%29]] on AMD64 ubuntu 6.10&lt;br /&gt;
     g++-3.4 -shared *.o -o libelfio.so&lt;br /&gt;
     /usr/bin/ld: ELFIDynamic.o: relocation R_X86_64_32 against `a local symbol&#039; can &lt;br /&gt;
     not be used when making a  shared object; recompile with -fPIC&lt;br /&gt;
     ELFIDynamic.o: could not read symbols: Bad value&#039;&#039;&#039;&lt;br /&gt;
* I got around this with &amp;quot;export CXXFLAGS=-fPIC&amp;quot; before configuring ELFIO. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====incompatible libopenjpeg.a when searching for -lopenjpeg====&lt;br /&gt;
 Building Client on Ubuntu 7.04 AMD64&lt;br /&gt;
     /usr/bin/ld: skipping incompatible /home/dereck/Desktop/SLdev/linden/libraries/i686-linux/lib_release_client/libopenjpeg.a when searching for -lopenjpeg&lt;br /&gt;
     /usr/bin/ld: cannot find -lopenjpeg&lt;br /&gt;
     collect2: ld returned 1 exit status&lt;br /&gt;
* I went to the OpenJPEG website, downloaded the source, compiled for my system, installed it. The VWR compile  was happy after that. Although it&#039;s not done yet and I&#039;m still fixing another error, that I assume is unrelated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====C-Ares compatability issue.====&lt;br /&gt;
Compiling with c-ares version 1.5.1 got a compile error in llares.cpp:&lt;br /&gt;
&lt;br /&gt;
linden/indra/x86_64-linux-client-release/llcommon/llares.cpp: In member function `void LLAres::getHostByName(const char*, LLAres::HostResponder*, int)&#039;:&lt;br /&gt;
&lt;br /&gt;
linden/indra/x86_64-linux-client-release/llcommon/llares.cpp:147: error: invalid conversion from `void (*)(void*, int, hostent*)&#039; to `void (*)(void*, int, int, hostent*)&#039;&lt;br /&gt;
&lt;br /&gt;
Fixed with patch from https://jira.secondlife.com/browse/VWR-3480&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====memset used with constant zero length parameter====&lt;br /&gt;
Building with -t Release causes memset error in /usr/include/bits/string3.h:82&lt;br /&gt;
The error is &amp;quot;/usr/include/bits/string3.h:82: error: call to `__warn_memset_zero_len&#039; declared with attribute warning: memset used with constant zero length parameter; this could be due to transposed parameters&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Patch: [http://jira.secondlife.com/browse/VWR-10001 VWR-10001]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Boost errors in Snowglobe (GCC &amp;gt;= 4.3)====&lt;br /&gt;
Build stops with errors: &amp;quot;../libraries/include/boost/token_functions.hpp:338: error: suggest explicit braces to avoid ambiguous &#039;else&#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
See [http://jira.secondlife.com/browse/SNOW-204 SNOW-204]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Gentoo: undefined reference to `FT_Realloc&#039;* from libpangoft2-1.0.so====&lt;br /&gt;
If you get an undefined reference to `FT_Realloc&#039;* from libpangoft2-1.0.so, you might have to delete some bundled libraries. [http://imprudenceviewer.org/wiki/How_to_compile#Removing_Bad_Libraries_on_Gentoo_Linux See here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Compiling viewer]]&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Common_compilation_problems&amp;diff=1196828</id>
		<title>Common compilation problems</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Common_compilation_problems&amp;diff=1196828"/>
		<updated>2015-07-01T18:04:42Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: /* C1083: Cannot open include file: &amp;#039;unistd.h&amp;#039; */ &amp;lt;php&amp;gt; to &amp;lt;source&amp;gt; and change language&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{CompileNav}}&lt;br /&gt;
&lt;br /&gt;
= General Problems =&lt;br /&gt;
&lt;br /&gt;
*  Make sure you download not only the source, but the artwork zipfile, and the appropriate zipfile/tarball of libraries for your platform&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Windows = &lt;br /&gt;
&lt;br /&gt;
== Viewer 1.19.1.4 / VS2003 ==&lt;br /&gt;
=== C1083: Cannot open include file: &#039;dxdiag.h&#039; ===&lt;br /&gt;
The DirectX SDK doesn&#039;t automatically insert its include directory into the VS2003 paths. For the June 2008 DirectX SDK release, go to Tools -&amp;gt; Options -&amp;gt; Projects (on left) -&amp;gt; VC++ Directories. On right show directories for Include files, and add:&lt;br /&gt;
* C:\Program Files\Microsoft DirectX SDK (June 2008)\Include&lt;br /&gt;
&lt;br /&gt;
=== C1083: Cannot open include file: &#039;unistd.h&#039; ===&lt;br /&gt;
On Apr 27, 2008 in thread &#039;&#039;[sldev] error while compiling on vc8/9 (unistd.h)&#039;&#039;, SLDev contributor wuhanzymail &amp;lt;wuhanzymail@163.com&amp;gt; recommended the following:&lt;br /&gt;
&lt;br /&gt;
1) right-click project lscript_compile, choose properties, c/c++, Preprocessor, add &#039;&#039;YY_NO_UNISTD_H&#039;&#039; to Preprcessor Definitions.&lt;br /&gt;
&lt;br /&gt;
2) in lex_yy.cpp, line 5915 change:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;           #ifndef __cplusplus&lt;br /&gt;
           extern int isatty (int );&lt;br /&gt;
           #endif&amp;lt;/source&amp;gt;&lt;br /&gt;
to:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;           #ifndef YY_NEVER_INTERACTIVE&lt;br /&gt;
           extern int isatty (int );&lt;br /&gt;
           #endif&amp;lt;/source&amp;gt;&lt;br /&gt;
3) still in lex_yy.cpp, line 5943 change:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;          b-&amp;gt;yy_is_interactive = file ? (isatty( fileno(file) ) &amp;gt; 0) : 0;&amp;lt;/source&amp;gt;&lt;br /&gt;
to:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;          #if YY_NEVER_INTERACTIVE&lt;br /&gt;
              b-&amp;gt;yy_is_interactive = 0;&lt;br /&gt;
          #else&lt;br /&gt;
              b-&amp;gt;yy_is_interactive = file ? (isatty( fileno(file) ) &amp;gt; 0) : 0;&lt;br /&gt;
          #endif&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C4018: &#039;&amp;lt;&#039; : signed/unsigned mismatch ===&lt;br /&gt;
On Apr 30, 2008 in thread &#039;&#039;[sldev] cygwin flex lscript_compile workaround&#039;&#039;, SLDev contributor Steve Linden recommended the following:&lt;br /&gt;
&lt;br /&gt;
I&#039;m not sure whether this has already been addressed here, but we &lt;br /&gt;
discovered a problem with the latest version of Cygwin flex and &lt;br /&gt;
lscript_compile and I thought I would share the workaround. We&#039;ve &lt;br /&gt;
committed the workaround to our release-candidate branche so it should &lt;br /&gt;
be in an upcoming source drop as well.&lt;br /&gt;
&lt;br /&gt;
1. Add &#039;&#039;YY_NO_UNISTD_H&#039;&#039; to the list of Preprocessor Definitions in the &lt;br /&gt;
lscript_compile project file.&lt;br /&gt;
&lt;br /&gt;
2. Apply the following patch it indra.l:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;php&amp;gt;Index: indra.l&lt;br /&gt;
===================================================================&lt;br /&gt;
--- indra.l    (revision 86342)&lt;br /&gt;
+++ indra.l    (revision 86343)&lt;br /&gt;
@@ -12,6 +12,7 @@&lt;br /&gt;
 #include &amp;quot;linden_common.h&amp;quot;&lt;br /&gt;
 // Deal with the fact that lex/yacc generates unreachable code&lt;br /&gt;
 #ifdef LL_WINDOWS&lt;br /&gt;
+#pragma warning (disable : 4018) // warning C4018: signed/unsigned mismatch&lt;br /&gt;
 #pragma warning (disable : 4702) // warning C4702: unreachable code&lt;br /&gt;
 #endif    //    LL_WINDOWS&lt;br /&gt;
 #include &amp;quot;llmath.h&amp;quot;&lt;br /&gt;
@@ -44,7 +45,10 @@&lt;br /&gt;
 &lt;br /&gt;
 #define YYLMAX 16384&lt;br /&gt;
 #define YY_NEVER_INTERACTIVE 1 /* stops flex from calling isatty() */&lt;br /&gt;
-&lt;br /&gt;
+#ifdef LL_WINDOWS&lt;br /&gt;
+#define isatty(x) 0 /* hack for bug in cygwin flex 2.5.35 */&lt;br /&gt;
+#endif&lt;br /&gt;
+&lt;br /&gt;
 #ifdef ECHO&lt;br /&gt;
 #undef ECHO&lt;br /&gt;
 #endif&lt;br /&gt;
&amp;lt;/php&amp;gt;&lt;br /&gt;
=== [...] error result returned from &#039;link.exe&#039; ===&lt;br /&gt;
By checking the Output window (View menu -&amp;gt; Other Windows), this shows up as an error saying: &#039;&#039;link: extra operand `/NOLOGO&#039; &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As reported by Brad Linden, this is caused by having the compiler executable directories in the wrong order, with the Cygwin directory path listed above the Visual Studio paths. This causes the Cygwin linker to be used instead of Visual Studio&#039;s linker.&lt;br /&gt;
&lt;br /&gt;
Go to Tools -&amp;gt; Options -&amp;gt; Projects -&amp;gt; VC++ Directories, show directories for Executables, and move &amp;quot;C:\cygwin\bin&amp;quot; to the bottom of the list.&lt;br /&gt;
&lt;br /&gt;
== Unresolved external symbol _CLSID_DxDiagProvider/_IID_IDxDiagProvider ==&lt;br /&gt;
* &#039;&#039;newview error LNK2001: unresolved external symbol _CLSID_DxDiagProvider&#039;&#039;&lt;br /&gt;
* &#039;&#039;newview error LNK2001: unresolved external symbol _IID_IDxDiagProvider&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These errors reportedly occur with MSVC 2003 and certain versions of the DirectX SDK.  To workaround, edit lldxhardware.cpp and replace the following (line 35):&lt;br /&gt;
&lt;br /&gt;
     #include &amp;lt;dxdiag.h&amp;gt;&lt;br /&gt;
with...&lt;br /&gt;
     #define INITGUID&lt;br /&gt;
     #include &amp;lt;dxdiag.h&amp;gt;&lt;br /&gt;
     #undef INITGUID&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cannot open input file &#039;dxguid.lib&#039; ==&lt;br /&gt;
* &#039;&#039;fatal error LNK1181: cannot open input file &#039;dxguid.lib&#039; in ...&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you are using a fairly recent DirectX SDK (&amp;quot;December 2006&amp;quot; or newer), your VC++ Libraries Directory may be wrong because the SDK&#039;s lib folder now has 2 sub-folders for x64 and x86.  Try changing the path from &#039;&#039;C:\Program Files\Microsoft DirectX SDK (December 2006)\Lib&#039;&#039; to &#039;&#039;C:\Program Files\Microsoft DirectX SDK (December 2006)\&#039;&#039; &#039;&#039;&#039;Lib\x86&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
== Cannot open input file &#039;dxerr8.lib&#039; ==&lt;br /&gt;
* &#039;&#039;fatal error LNK1104: cannot open file &#039;dxerr8.lib&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you are using the most recent DirectX SDK (&amp;quot;November 2007&amp;quot;), the file dxerr8.lib does no longer exist. To fix this, you&#039;ll need to change the newview project to include &#039;dxerr9.lib&#039; instead. To do this, right-lick newview &amp;gt; Configuration Properties &amp;gt; Linker &amp;gt; Input, click Additional Dependencies on the right to show a button labeled &amp;quot;...&amp;quot; on it at the very right on the line, then click the ... button. Scroll down the list to find &#039;dxerr8.lib&#039;. Rewrite it to &#039;dxerr9.lib&#039;. Remember to do this for both the ReleaseForDownload and the ReleaseNoOpt Configurations.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== A tool returned an error code from &amp;quot;Building ytab.cpp&amp;quot; ==&lt;br /&gt;
* &#039;&#039;lscript_compile_fb error PRJ0019: A tool returned an error code from &amp;quot;Building ytab.cpp&amp;quot; &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
One possible reason for this is that Visual Studio does not know where cygwin/bin is, especially if this is accompanied by an error relating to bison.exe being an invalid command.  Even if the directory for cygwin is in the environment variable PATH, Visual Studio maintains its own separate copy which does not seem to be automatically synchronized after the initial installation.&lt;br /&gt;
&lt;br /&gt;
For Visual Studio .NET 2003, go to Tools &amp;gt; Options &amp;gt; Projects &amp;gt; VC++ Directories.  In the &amp;quot;show directories for&amp;quot; dropdown, choose &amp;quot;Executable files&amp;quot;.  Make sure that your cygwin (default C:\cygwin\bin) and ActivePython (default C:\Python25) directories are listed.&lt;br /&gt;
&lt;br /&gt;
== Cannot open include file: &#039;ytab.h&#039;: No such file or directory ==&lt;br /&gt;
* &#039;&#039;indra.l (20) : fatal error C1083: Cannot open include file: &#039;ytab.h&#039;: No such file or directory.&#039;&#039;&lt;br /&gt;
Workaround: Manually copy &amp;quot;linden\indra\lscript\lscript_compile\ytab.hpp&amp;quot; to &amp;quot;linden\indra\lscript\lscript_compile\ytab.h&amp;quot; and build again. &lt;br /&gt;
&lt;br /&gt;
Note: The underlying issue is that in indra.y there is a postbuild step which should do this automatically, but which is missing in some configurations (e.g. in Debug builds).&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
== Cannot open include file: &#039;png.h&#039;: No such file or directory ==&lt;br /&gt;
* &#039;&#039;imagepng.cpp : fatal error C1083: Cannot open include file: &#039;libpng12/png.h&#039;: No such file or directory.&#039;&#039;&lt;br /&gt;
There are a couple of files missing since the 1.17. distribution.  You can either get the missing files from the internet (from the libpng and zlib projects) or download a set with just the missing files from [http://www.blueflash.cc/users/nicholaz/~libs here] (see the readme.txt inside the png archive there).&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
== Cannot open include file: &#039;glh/glh_linear.h&#039; or &#039;glh/glh_convenience.h&#039; ==&lt;br /&gt;
These files are currently missing from Linden Windlight distributions.  See [https://jira.secondlife.com/browse/VWR-3415 JIRA VWR-3415] or grab a copy from [http://www.blueflash.cc/users/nicholaz/~libs here] and put the files into a folder named linden/libraries/include/glh.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Errors relating to &amp;quot;template_verifier.py&amp;quot; ==&lt;br /&gt;
With version 1.18 a template verifier script written in Python is used to ensure the message template is correct.  In some distributions the file was missing.  You will also get an error if you have skipped the Python install.  In both cases it is safe to hack the prebuild.bat file in the newview folder as described on the JIRA [http://jira.secondlife.com/browse/VWR-1267 VWR-1267]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Missing resources ==&lt;br /&gt;
* &#039;&#039;.\res\newViewRes.rc(64) : error RC2135 : file not found: ll_icon.ico&#039;&#039;&lt;br /&gt;
Some releases have missing files, which were reported to be last seen in the &#039;&#039;&#039;1.14.0.1&#039;&#039;&#039; release.&lt;br /&gt;
* Go to the [[source downloads]] page and grab the [[http://secondlife.com/developers/opensource/downloads/2007/04/slviewer-src-1.14.0.1.zip &#039;&#039;&#039;1.14.0.1&#039;&#039;&#039; viewer]] sources.&lt;br /&gt;
* Explore the archive to &amp;quot;linden/indra/newview/res&amp;quot; folder and extract content to your &amp;quot;linden/indra/newview/res&amp;quot; folder into current revision.&lt;br /&gt;
Missing folder in recent release, &amp;quot;&#039;&#039;&#039;1.17.0.12&#039;&#039;&#039;&amp;quot; which causes the SecondLife to hang while loading into the world.&lt;br /&gt;
* Go to the previous source and copy the missing folder, &amp;quot;Character&amp;quot; and place it into the &amp;quot;newview&amp;quot; folder&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
== Error code from &amp;quot;Copying message template&amp;quot; ==&lt;br /&gt;
* &#039;&#039;newview error PRJ0019: A tool returned an error code from &amp;quot;Copying message template&amp;quot;&#039;&#039;&lt;br /&gt;
This is caused by the script trying to do a copy command, but the source path isn&#039;t in quotes.  Open up newview.vcproj in notepad, and near the bottom there are 4 line that say:&lt;br /&gt;
     CommandLine=&amp;quot;copy $(InputPath) .\app_settings\message_template.msg&lt;br /&gt;
replace them with&lt;br /&gt;
     CommandLine=&amp;quot;copy &amp;amp;amp;quot;$(InputPath)&amp;amp;amp;quot; .\app_settings\message_template.msg&lt;br /&gt;
The source and destination paths on line 158 may also require wrapping in quotes.  In which case:&lt;br /&gt;
     CommandLine=&amp;quot;copy $(TargetDir)\$(TargetFileName) $(ProjectDir)&lt;br /&gt;
should become:&lt;br /&gt;
     CommandLine=&amp;quot;copy &amp;amp;amp;quot;$(TargetDir)\$(TargetFileName)&amp;amp;amp;quot; &amp;amp;amp;quot;$(ProjectDir)&amp;amp;amp;quot;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
== Can not find library ll*.lib ==&lt;br /&gt;
If you get a compile error for missing libraries with names of the projects (lscript_compile.lib, llaudio.lib, llcharacter.lib, etc.) go to newview &amp;gt; Properties &amp;gt; Linker &amp;gt; Input and remove these from the list of input libraries (they will be linked through the dependencies and should not be in the list).&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cannot open include file: &#039;windows.h&#039; ==&lt;br /&gt;
If you run into this problem:&lt;br /&gt;
 ..\..\..\boost/regex/v4/fileiter.hpp(44) : fatal error C1083: Cannot open include file: &#039;windows.h&#039;: No such file or directory&lt;br /&gt;
Fix it with this: (thanks Fairlight!)&lt;br /&gt;
 set INCLUDE=C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include;%INCLUDE%&lt;br /&gt;
 set LIB=C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib;%LIB%&lt;br /&gt;
You might need to edit the above path to refer to your particular platform SDK.  If you don&#039;t have the Microsoft Windows Platform SDK installed, then you can download it for free from Microsoft.  It is version specific and can be tricky to find on their website.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re having problems with windows.h in Visual Studio Express 2005, check out this forum post:&lt;br /&gt;
[http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1995837&amp;amp;SiteID=1 MSDN Forum Post]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Unresolved external symbol &amp;quot;int __cdecl lscript_compile&amp;quot; (VS2005) ==&lt;br /&gt;
* &#039;&#039;llcompilequeue.obj : error LNK2019: unresolved external symbol &amp;quot;int __cdecl lscript_compile(char const *,char const *,char const *,int)&amp;quot; (?lscript_compile@@YAHPBD00H@Z) referenced in function &amp;quot;protected: void __thiscall LLFloaterCompileQueue::compile(char const *,class LLUUID const &amp;amp;)&amp;quot; (?compile@LLFloaterCompileQueue@@IAEXPBDABVLLUUID@@@Z)&#039;&#039;&lt;br /&gt;
* &#039;&#039;llpreviewscript.obj : error LNK2001: unresolved external symbol &amp;quot;int __cdecl lscript_compile(char const *,char const *,char const *,int)&amp;quot; (?lscript_compile@@YAHPBD00H@Z)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is not entirely clear, but there seems to be a problem with VS2005 if projects are unloaded while being in the dependency tree.  I have seen this error while I had win_crash_logger and win_updater unloaded from the project tree and the problem went away when I loaded them back and excluded them from the newview dependency first.&lt;br /&gt;
&lt;br /&gt;
Also make sure that in newview, properties, linker, input, input libraries, no libraries named ll*.lib and lscript_compile.lib are listed there (remove them if you find them).&lt;br /&gt;
&lt;br /&gt;
Also be sure that your error does not come from previously in the log: like the cgywin component bison not being found. For MSVS2005 Express, you may need to go to tools&amp;gt;options&amp;gt;Projects and Solutions&amp;gt;VC++ Directories&amp;gt;Executable files and add the directory for cgywin. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Unresolved external symbol __invalid_parameter_noinfo (VS2005) ==&lt;br /&gt;
* &#039;&#039;llmozlib-vc80.lib(llembeddedbrowserwindow.obj) : error LNK2019: unresolved external symbol __invalid_parameter_noinfo referenced&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You are most likely trying a debug build under VS2005.  For debug builds, see the compile instruction section on [[finding_leaks]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cannot open include file: &#039;ares.h&#039; ==&lt;br /&gt;
download src from http://daniel.haxx.se/projects/c-ares/&lt;br /&gt;
&lt;br /&gt;
compile c-ares-1.4.0/vc/areslib&lt;br /&gt;
&lt;br /&gt;
copy c-ares-1.4.0/vc/areslib/Release/areslib.lib to linden/libraries/i686-win32/lib_release and to lib_debug&lt;br /&gt;
&lt;br /&gt;
copy c-ares-1.4.0/*.h to linden/libraries/i686-win32/include/ares&lt;br /&gt;
&lt;br /&gt;
===FMOD===&lt;br /&gt;
FMOD headers and libs need to be copied into the viewer build directory BUT on Windows the manifests are not currently moving the libs to the correct location post build so the application will fail to run, to resolve copy fmod.dll to indra/build-vc71/newview/debug and indra/build-vc71/newview/relwithdebinfo and indra/build-vc71/newview/release&lt;br /&gt;
&lt;br /&gt;
===Boost and VS 2008===&lt;br /&gt;
If you use Visual Studio C++ 2008 (VC90), you may find that the Boost library will lock up solid and the viewer will not tun consuming 50-100% of CPU doing nothing. The only solutions are to use Visual Studio 2005 OR to get a newer version/rebuild boost with Visual Studio 2008.&lt;br /&gt;
&lt;br /&gt;
This problem is being worked on. Look here for updates: [https://jira.secondlife.com/browse/VWR-9541 VWR-9541]&lt;br /&gt;
&lt;br /&gt;
===Express editions of Visual C++===&lt;br /&gt;
Express editions do not have some of the extra features that VSTool.exe requires, VSTool is a little application that sets a few default project options, like which project is the startup and which build configuration to use.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===LLKDU===&lt;br /&gt;
This is not present in the automated libs download but is required at least on windows by the copy_win_scrips script. The file is not actually needed for the viewer to run (if present it will be used for jpeg2000 decoding in preference to Openjpeg. The solution is to remove the lines from newview/copy_win_scripts that reference llkdu and this should then allow this custom build step to run without issue&lt;br /&gt;
&lt;br /&gt;
=== [...]/CMakeDetermineCompilerABI_C.bin cannot be read. ===&lt;br /&gt;
Occurs on Windows 7, make sure your running the cmd shell (or whatever your using to run the &amp;quot;python develop.py&amp;quot;) with Administrator privileges.&lt;br /&gt;
&lt;br /&gt;
== fatal error C1060: compiler is out of heap space ==&lt;br /&gt;
If you are not using Incredibuild and have precompiled headers disabled, you may encounter this error.&lt;br /&gt;
Try enabling building with precompiled headers:&lt;br /&gt;
&amp;lt;pre&amp;gt;autobuild configure -c [configuration] -- -DUSE_PRECOMPILED_HEADERS:BOOL=ON&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Other (older) notes ==&lt;br /&gt;
* Mozilla is not compatible with visual studio 2005, so we have not migrated the codebase, so we do not know if it works. &lt;br /&gt;
&lt;br /&gt;
* Added my errors at [[User:Adam_Zaius/MSVS2005 Errors]] [[User:Adam Zaius|Adam Zaius]] 09:40, 8 January 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
* To minimize the number of warnings for now: in C/C++-Preprocessor add &#039;;_CRT_SECURE_NO_DEPRECATE&#039; to the Preprocessor Definitions, that will supress deprecation warnings --[[User:Artm Udal|Artm Udal]] 12:42, 8 January 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Mac OS X =&lt;br /&gt;
&lt;br /&gt;
Getting:&lt;br /&gt;
&lt;br /&gt;
*/linden/indra/newview/../llwindow/llglheaders.h:377:31: error: GL/glh_extensions.h: No such file or directory&lt;br /&gt;
** This means you didn&#039;t [[Compiling the viewer (Mac OS X)#Viewer Source, Libraries, and Artwork|merge the libraries]] right.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Linux =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== libGL ===&lt;br /&gt;
&lt;br /&gt;
Sometimes the provide libGL.a can cause issues.  To avoid linker errors, you may need to remove indra/libraries/i686-linux/release/libGL.a and indra/libraries/i686-linux/debug/libGL.a&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Packaging errors ===&lt;br /&gt;
&lt;br /&gt;
The final packaging step may fail with errors about the manifest if you are not using the &amp;lt;i&amp;gt;slviewer-linux-libs&amp;lt;/i&amp;gt; bundle; in this case, if you still wish to end up with an end-user viewer package incorporating your own libraries, you can edit the manifest file found at &amp;lt;b&amp;gt;indra/newview/viewer_manifest.py&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Various Compilation problems ===&lt;br /&gt;
&lt;br /&gt;
====Various missing libraries====&lt;br /&gt;
&amp;lt;pre&amp;gt;g++-3.4 -o linux_crash_logger/linux-crash-logger-i686-bin-globalsyms --no-keep-memory --reduce-memory-overheads /tmp/paul/home/paul/builds/secondlife/src/linden/indra/i686-linux-client-release/llcrashlogger/llcrashlogger.o /tmp/paul/home/paul/builds/secondlife/src/linden/indra/i686-linux-client-release/linux_crash_logger/linux_crash_logger.o /tmp/paul/home/paul/builds/secondlife/src/linden/indra/i686-linux-client-release/linux_crash_logger/llcrashloggerlinux.o -Llib_release_client/i686-linux -L/home/paul/builds/secondlife/src/linden/libraries/i686-linux/lib_release_client -lllui -lllxml -lllmessage -lllvfs -lllmath -lllcommon -lcurl -lssl -lcrypto -laprutil-1 -lapr-1 -lcares -lexpat -ldb-4.2 -lgtk-x11-2.0&lt;br /&gt;
/usr/bin/ld: skipping incompatible /home/paul/builds/secondlife/src/linden/libraries/i686-linux/lib_release_client/libcurl.a when searching for -lcurl&lt;br /&gt;
/usr/bin/ld: skipping incompatible /home/paul/builds/secondlife/src/linden/libraries/i686-linux/lib_release_client/libssl.so when searching for -lssl&lt;br /&gt;
/usr/bin/ld: skipping incompatible /home/paul/builds/secondlife/src/linden/libraries/i686-linux/lib_release_client/libcrypto.so when searching for -lcrypto&lt;br /&gt;
/usr/bin/ld: skipping incompatible /home/paul/builds/secondlife/src/linden/libraries/i686-linux/lib_release_client/libaprutil-1.so when searching for -laprutil-1&lt;br /&gt;
/usr/bin/ld: skipping incompatible /home/paul/builds/secondlife/src/linden/libraries/i686-linux/lib_release_client/libapr-1.so when searching for -lapr-1&lt;br /&gt;
/usr/bin/ld: skipping incompatible /home/paul/builds/secondlife/src/linden/libraries/i686-linux/lib_release_client/libcares.a when searching for -lcares&lt;br /&gt;
/usr/bin/ld: skipping incompatible /home/paul/builds/secondlife/src/linden/libraries/i686-linux/lib_release_client/libexpat.so when searching for -lexpat&lt;br /&gt;
/usr/bin/ld: skipping incompatible /home/paul/builds/secondlife/src/linden/libraries/i686-linux/lib_release_client/libdb-4.2.so when searching for -ldb-4.2&lt;br /&gt;
/usr/bin/ld: cannot find -ldb-4.2&lt;br /&gt;
collect2: ld returned 1 exit status&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 [paul@myhost secondlife]$ pacman -Q db&lt;br /&gt;
 db 4.6.21-2&lt;br /&gt;
&lt;br /&gt;
 [paul@myhost secondlife]$ uname -a&lt;br /&gt;
 Linux myhost 2.6.23-ARCH #1 SMP PREEMPT Tue Jan 15 07:17:51 CET 2008 x86_64 Intel(R) Celeron(R) CPU 2.66GHz GenuineIntel GNU/Linux&lt;br /&gt;
&lt;br /&gt;
And using:&amp;lt;pre&amp;gt;&lt;br /&gt;
source=(&#039;secondlife.desktop&#039; &#039;secondlife.install&#039; &#039;secondlife.launcher&#039; \&lt;br /&gt;
&amp;quot;http://secondlife.com/developers/opensource/downloads/2008/01/slviewer-src-RC-${pkgver}.tar.gz&amp;quot; \&lt;br /&gt;
&#039;http://secondlife.com/developers/opensource/downloads/2007/12/slviewer-artwork-RC-1.18.6.2.zip&#039; \&lt;br /&gt;
&#039;http://secondlife.com/developers/opensource/downloads/2007/12/slviewer-linux-libs-RC-1.18.6.2.tar.gz&#039; \&lt;br /&gt;
&#039;http://www.fmod.org/index.php/release/version/fmodapi375linux.tar.gz&#039; \&lt;br /&gt;
&#039;http://secondlife.com/developers/opensource/downloads/2007/12/llmozlib-src-20071221.tar.gz&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hum ok, I was trying to use:&lt;br /&gt;
 scons DISTCC=no BTARGET=client BUILD=release MOZLIB=yes&lt;br /&gt;
&lt;br /&gt;
I&#039;ll retry with:&lt;br /&gt;
 scons BUILD=release ARCH=x86_64 BTARGET=client DISTCC=no MOZLIB=yes FMOD=yes GSTREAMER=yes STANDALONE=yes&lt;br /&gt;
(Sconstruct says that with STANDALONE=yes -db-4.2 will not be used)&lt;br /&gt;
&lt;br /&gt;
But at the beginning I get:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
scons: Reading SConscript files ...&lt;br /&gt;
Building client 1.18.6.2 on x86_64-linux (release)&lt;br /&gt;
No CCACHE_DIR set.&lt;br /&gt;
&lt;br /&gt;
scons: warning: Two different environments were specified for target /tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llcrashlogger/llcrashlogger.o&amp;gt;,&lt;br /&gt;
	but they appear to have the same action: $CXX -o $TARGET -c $CXXFLAGS $_CCCOMCOM $SOURCES&lt;br /&gt;
File &amp;quot;/home/paul/builds/secondlife/src/linden/indra/SConstruct&amp;quot;, line 568, in create_executable&lt;br /&gt;
scons: done reading SConscript files.&lt;br /&gt;
scons: Building targets ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
well, the new scons line give different problem:&lt;br /&gt;
&amp;lt;pre&amp;gt;g++ -o /tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llmath/llquaternion.o -c -g -pipe -Wall -Wno-reorder -Wno-trigraphs -Wno-sign-compare -Werror -fexceptions -pthread -D_REENTRANT -fno-math-errno -fsigned-char -fno-strict-aliasing -falign-loops=16 -ffast-math -O2 -D_FORTIFY_SOURCE=2 -DLL_STANDALONE -DLL_MESA_HEADLESS=0 -DLL_MESA=0 -DLL_LINUX=1 -DAPPID=secondlife -DLL_SDL=1 -DLL_FMOD=0 -DLL_X11=1 -DLL_GTK=1 -DLL_LIBXUL_ENABLED=1 -DLL_GSTREAMER_ENABLED=1 -DNDEBUG -DLL_RELEASE=1 -Illcommon -Illmath -Illwindow -Illaudio -Illcharacter -Illcrashlogger -Illdatabase -Illhavok -Illimage -Illinventory -Illmedia -Illmessage -Illprimitive -Illrender -Illscene -Illui -Illvfs -Illwindow -Illxml -Ilscript -Ilscript/lscript_compile -I/home/paul/builds/secondlife/src/linden/libraries/include -I/home/paul/builds/secondlife/src/linden/libraries/include/havok -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include -I/usr/include/atk-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/SDL -I/usr/include/apr-1 -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/gstreamer-0.10 -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/glib-2.0 -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/glib-2.0/include -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/libxml2 /tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llmath/llquaternion.cpp&lt;br /&gt;
cc1plus: warnings being treated as errors&lt;br /&gt;
/tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llmath/llquaternion.cpp: In function &#039;const char* OrderToString(LLQuaternion::Order)&#039;:&lt;br /&gt;
/tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llmath/llquaternion.cpp:701: warning: deprecated conversion from string constant to &#039;char*&#039;&lt;br /&gt;
/tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llmath/llquaternion.cpp:704: warning: deprecated conversion from string constant to &#039;char*&#039;&lt;br /&gt;
/tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llmath/llquaternion.cpp:707: warning: deprecated conversion from string constant to &#039;char*&#039;&lt;br /&gt;
/tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llmath/llquaternion.cpp:710: warning: deprecated conversion from string constant to &#039;char*&#039;&lt;br /&gt;
/tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llmath/llquaternion.cpp:713: warning: deprecated conversion from string constant to &#039;char*&#039;&lt;br /&gt;
/tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llmath/llquaternion.cpp:716: warning: deprecated conversion from string constant to &#039;char*&#039;&lt;br /&gt;
scons: *** [/tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llmath/llquaternion.o] Error 1&lt;br /&gt;
scons: building terminated because of errors.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well, STANDALONE=yes make it use g++ rather than g++-3.4, so I decided to remove it, keeping&lt;br /&gt;
ARCH=X86_64 and others, but I get:&lt;br /&gt;
&amp;lt;pre&amp;gt;ranlib lib_release_client/x86_64-linux/libllprimitive.a&lt;br /&gt;
g++-3.4 -o /tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llrender/llfont.o -c -g -pipe -Wall -Wno-reorder -Wno-trigraphs -Wno-sign-compare -Werror -fexceptions -pthread -D_REENTRANT -fno-math-errno -fsigned-char -fno-strict-aliasing -falign-loops=16 -ffast-math -O2 -D_FORTIFY_SOURCE=2 -DLL_MESA_HEADLESS=0 -DLL_MESA=0 -DLL_LINUX=1 -DAPPID=secondlife -DLL_SDL=1 -DLL_FMOD=0 -DLL_X11=1 -DLL_GTK=1 -DLL_LIBXUL_ENABLED=1 -DLL_GSTREAMER_ENABLED=1 -DNDEBUG -DLL_RELEASE=1 -Illcommon -Illmath -Illwindow -Illaudio -Illcharacter -Illcrashlogger -Illdatabase -Illhavok -Illimage -Illinventory -Illmedia -Illmessage -Illprimitive -Illrender -Illscene -Illui -Illvfs -Illwindow -Illxml -Ilscript -Ilscript/lscript_compile -I/home/paul/builds/secondlife/src/linden/libraries/include -I/home/paul/builds/secondlife/src/linden/libraries/include/havok -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/ELFIO -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/atk-1.0 -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/glib-2.0 -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/gtk-2.0 -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/llfreetype2 -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/pango-1.0 -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/gstreamer-0.10 -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/glib-2.0 -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/glib-2.0/include -I/home/paul/builds/secondlife/src/linden/libraries/x86_64-linux/include/libxml2 /tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llrender/llfont.cpp&lt;br /&gt;
/tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llrender/llfont.cpp:41:44: llfreetype2/freetype/ft2build.h: No such file or directory&lt;br /&gt;
/tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llrender/llfont.cpp:56: error: `FT_Render_Mode&#039; does not name a type&lt;br /&gt;
/tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llrender/llfont.cpp:60: error: `FT_Library&#039; does not name a type&lt;br /&gt;
/tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llrender/llfont.cpp: In constructor `LLFontManager::LLFontManager()&#039;:&lt;br /&gt;
/tmp/paul/home/paul/builds/secondlife/src/linden/indra/x86_64-linux-client-release/llrender/llfont.cpp:78: error: `gFTLibrary&#039; was not declared in this scope&lt;br /&gt;
... [many more errors]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
oh well, SConstruct says I need: cairo glib-2.0 atk gmobile-2.0 gdk-2.0 gdk-pixbuf-2.0 pango pangoft2 pangox pangoxft gtk+-2.0 sdl vorbis vorbisenc vorbisfile&lt;br /&gt;
&lt;br /&gt;
Maybe this is pangoft2 that is missing.&lt;br /&gt;
&lt;br /&gt;
* This part is probably not relevant anymore --[[USER:Thickbrick Sleaford|Thickbrick]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====&amp;quot;Unable to initialize communications&amp;quot;====&lt;br /&gt;
* If the viewer just displays the error message &amp;quot; Unable to initialize communications&amp;quot; and exits, it can&#039;t find message_template.msg. You did remember to copy it over, right?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Blino&#039;s SL build/linking patches for &#039;&#039;&#039;gcc4&#039;&#039;&#039;====&lt;br /&gt;
http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/secondlife/current/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====objcopy: &amp;lt;b&amp;gt;&#039;newview/linux_tools/exposed-symbols.txt&#039;&amp;lt;/b&amp;gt;: No such file====&lt;br /&gt;
* Tofu says... &#039;This is an omission from our manifest which I&#039;ll fix.  Meanwhile it&#039;s a safe fix to create an empty file with that name.&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Something like: &amp;lt;b&amp;gt;/usr/bin/ld: cannot find -lz&amp;lt;/b&amp;gt;====&lt;br /&gt;
* Nadia says: Install the zlib development headers. (Ubuntu package zlib1g-dev, Red Hat zlib-devel.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Something like: indra.y.cpp:17: &amp;lt;b&amp;gt;error: previous declaration of `int yyparse()&#039;&amp;lt;/b&amp;gt;====&lt;br /&gt;
* Tofu says... &#039;This appears to be a problem with some versions of flex/bison.  A resident reports success when comment out the &amp;lt;i&amp;gt;#ifdef __cplusplus&amp;lt;/i&amp;gt; lines in lscript/lscript_compile/indra.y&#039;&lt;br /&gt;
* Nadia says: install the zlib development headers first and try recompiling. Commenting out those lines results in a error indra.l:666: &amp;lt;b&amp;gt;undefined&amp;lt;/b&amp;gt;&lt;br /&gt;
* Abi says: I forgot to install bison.  Once I did that, problem solved.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Linking failures (&amp;quot;script not found&amp;quot;) due to spaces in the LINKFLAGS variable?====&lt;br /&gt;
* I saw a [http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4665538 report], and modified the SConstruct file to drop the trailing arguments (and spaces) in LINKFLAGS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====&#039;&#039;cp: target `SecondLife_i686_1_13_1_7/app_settings/*’ is not a directory&#039;&#039;====&lt;br /&gt;
Building [https://lists.secondlife.com/pipermail/sldev/2007-January/000091.html 20070112a] using &#039;&#039;BUILD=releasefordownload&#039;&#039; I get many &#039;&#039;[: 89: ==: unexpected operator&#039;&#039; errors; &#039;&#039;cp: target `SecondLife_i686_1_13_1_7/app_settings/*’ is not a directory&#039;&#039; error, and same thing for character, fonts, help, skins, res-sdl; &#039;&#039;[: 111: ==: unexpected operator, [: 120: SecondLife_i686_1_13_1_7.tar.bz2: unexpected operator&#039;&#039;. I can succesfully run the client from the source tree.&lt;br /&gt;
* i think this has been fixed --[[User:Signore Iredell|Signore Iredell]] 06:09, 9 June 2007 (PDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====`[&#039;.../lscript/lscript_compile/indra.l.cpp&#039;]&#039;: Don&#039;t know how to build a file with suffix `.l&#039;====&lt;br /&gt;
scons: *** While building `[&#039;.../linden/indra/i686-linux-client-release/lscript/lscript_compile/indra.l.cpp&#039;]&#039;: Don&#039;t know how to build a file with suffix `.l&#039;.&lt;br /&gt;
* You probably don&#039;t have all the dependencies installed (I had the same problem). Check that you have flex and bison. --[[User:Random73 Janus|Random73 Janus]] 07:43, 16 May 2007 (PDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====`glActiveTextureARB&#039; was not declared in this scope====&lt;br /&gt;
Something like: linden/indra/i686-linux-client-release/llrender/llimagegl.cpp:122: &amp;lt;b&amp;gt;error: `glActiveTextureARB&#039; was not declared in this scope&amp;lt;/b&amp;gt;	 &lt;br /&gt;
* Tofu says... &#039;You&#039;ll need to install OpenGL headers if you don&#039;t already have them: gl.h, glext.h, glu.h (The ones from &#039;mesa&#039; should work)	 &lt;br /&gt;
* two residents report good luck on Gentoo after doing &#039;eselect opengl set xorg-x11&#039; (&amp;lt;b&amp;gt;but note!!&amp;lt;/b&amp;gt; You must know what you&#039;re doing; this may change your default system OpenGL drivers, and you will probably want to change them back again after the compile, e.g. &#039;eselect opengl set nvidia&#039;)&#039;&lt;br /&gt;
* Note that the above xorg-x11/nvidia issue is addressed in [http://jira.secondlife.com/browse/VWR-9557 VWR-9557] which includes patches!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Building Shared Library ELFIO====&lt;br /&gt;
 Building Shared Library ELFIO [[Compiling_the_viewer_%28Linux%29]] on AMD64 ubuntu 6.10&lt;br /&gt;
     g++-3.4 -shared *.o -o libelfio.so&lt;br /&gt;
     /usr/bin/ld: ELFIDynamic.o: relocation R_X86_64_32 against `a local symbol&#039; can &lt;br /&gt;
     not be used when making a  shared object; recompile with -fPIC&lt;br /&gt;
     ELFIDynamic.o: could not read symbols: Bad value&#039;&#039;&#039;&lt;br /&gt;
* I got around this with &amp;quot;export CXXFLAGS=-fPIC&amp;quot; before configuring ELFIO. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====incompatible libopenjpeg.a when searching for -lopenjpeg====&lt;br /&gt;
 Building Client on Ubuntu 7.04 AMD64&lt;br /&gt;
     /usr/bin/ld: skipping incompatible /home/dereck/Desktop/SLdev/linden/libraries/i686-linux/lib_release_client/libopenjpeg.a when searching for -lopenjpeg&lt;br /&gt;
     /usr/bin/ld: cannot find -lopenjpeg&lt;br /&gt;
     collect2: ld returned 1 exit status&lt;br /&gt;
* I went to the OpenJPEG website, downloaded the source, compiled for my system, installed it. The VWR compile  was happy after that. Although it&#039;s not done yet and I&#039;m still fixing another error, that I assume is unrelated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====C-Ares compatability issue.====&lt;br /&gt;
Compiling with c-ares version 1.5.1 got a compile error in llares.cpp:&lt;br /&gt;
&lt;br /&gt;
linden/indra/x86_64-linux-client-release/llcommon/llares.cpp: In member function `void LLAres::getHostByName(const char*, LLAres::HostResponder*, int)&#039;:&lt;br /&gt;
&lt;br /&gt;
linden/indra/x86_64-linux-client-release/llcommon/llares.cpp:147: error: invalid conversion from `void (*)(void*, int, hostent*)&#039; to `void (*)(void*, int, int, hostent*)&#039;&lt;br /&gt;
&lt;br /&gt;
Fixed with patch from https://jira.secondlife.com/browse/VWR-3480&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====memset used with constant zero length parameter====&lt;br /&gt;
Building with -t Release causes memset error in /usr/include/bits/string3.h:82&lt;br /&gt;
The error is &amp;quot;/usr/include/bits/string3.h:82: error: call to `__warn_memset_zero_len&#039; declared with attribute warning: memset used with constant zero length parameter; this could be due to transposed parameters&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Patch: [http://jira.secondlife.com/browse/VWR-10001 VWR-10001]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Boost errors in Snowglobe (GCC &amp;gt;= 4.3)====&lt;br /&gt;
Build stops with errors: &amp;quot;../libraries/include/boost/token_functions.hpp:338: error: suggest explicit braces to avoid ambiguous &#039;else&#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
See [http://jira.secondlife.com/browse/SNOW-204 SNOW-204]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Gentoo: undefined reference to `FT_Realloc&#039;* from libpangoft2-1.0.so====&lt;br /&gt;
If you get an undefined reference to `FT_Realloc&#039;* from libpangoft2-1.0.so, you might have to delete some bundled libraries. [http://imprudenceviewer.org/wiki/How_to_compile#Removing_Bad_Libraries_on_Gentoo_Linux See here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Compiling viewer]]&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlGetRot&amp;diff=1196827</id>
		<title>LlGetRot</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlGetRot&amp;diff=1196827"/>
		<updated>2015-07-01T17:41:45Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: &amp;lt;lsl&amp;gt; to &amp;lt;source&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL_Function&lt;br /&gt;
|func=llGetRot&lt;br /&gt;
|sort=GetRot&lt;br /&gt;
|func_id=62|func_sleep=0.0|func_energy=10.0&lt;br /&gt;
|func_desc&lt;br /&gt;
|func_footnote&lt;br /&gt;
|return_type=rotation&lt;br /&gt;
|return_text=that is the prim&#039;s rotation relative to the [[Viewer coordinate frames#Region|region]]&#039;s axes.&lt;br /&gt;
|constants&lt;br /&gt;
|spec&lt;br /&gt;
|caveats=&lt;br /&gt;
* [[llGetRot]] incorrectly reports the avatars rotation when called from the root of an attached object, use [[llGetLocalRot]] for root prims, instead&lt;br /&gt;
** [[llGetRot]] will return an accurate facing for Avatars seated or in mouselook, but only a rough direction otherwise when called from an attached prim.&lt;br /&gt;
**When called in an attachment&#039;s child prim, the reported rotation will only be visually correct if the object&#039;s root is attached to [[ATTACH_AVATAR_CENTER]], at [[ZERO_ROTATION]]. Moving the attachment&#039;s root or changing the attachment point will not affect the reported rotation. Avatar animation is invisible to the simulator, so it also does not affect the reported rotation. Also see [[Rotation#Single_or_Root_Prims_vs_Linked_Prims_vs_Attachments|Single or Root Prims vs Linked Prims vs Attachments]].&lt;br /&gt;
|examples=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt; //-- rotates an object to face the nearest cardinal direction (N,E,S,W)&lt;br /&gt;
 //-- assumes build is aligned to root object facing&lt;br /&gt;
&lt;br /&gt;
default{&lt;br /&gt;
  state_entry()&lt;br /&gt;
  {&lt;br /&gt;
    llSay( 0, &amp;quot;Rotate me in edit, then touch to make me face the nearest compass point&amp;quot; );&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  touch_start( integer vIntTouches )&lt;br /&gt;
  {&lt;br /&gt;
     //-- convert our rotation to x/y/z radians&lt;br /&gt;
    vector vRadBase = llRot2Euler( llGetRot() );&lt;br /&gt;
     //-- round the z-axis to the nearest 90deg (PI_BY_TWO = 90deg in radians)&lt;br /&gt;
    llSetRot( llEuler2Rot( &amp;lt;0.0, 0.0, llRound( vRadBase.z / PI_BY_TWO ) * PI_BY_TWO &amp;gt; ) );&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
|helpers&lt;br /&gt;
|also_header&lt;br /&gt;
|also_functions=&lt;br /&gt;
{{LSL DefineRow||[[llGetLocalRot]]|}}&lt;br /&gt;
{{LSL DefineRow||[[llGetRootRotation]]|}}&lt;br /&gt;
{{LSL DefineRow||[[llGetPrimitiveParams]]|}}&lt;br /&gt;
{{LSL DefineRow||[[llSetRot]]|}}&lt;br /&gt;
{{LSL DefineRow||[[llSetLocalRot]]|}}&lt;br /&gt;
{{LSL DefineRow||[[llSetPrimitiveParams]]|}}&lt;br /&gt;
{{LSL DefineRow||[[llSetLinkPrimitiveParams]]|}}&lt;br /&gt;
{{LSL DefineRow||[[llSetLinkPrimitiveParamsFast]]|}}&lt;br /&gt;
|also_tests&lt;br /&gt;
|also_events&lt;br /&gt;
|also_articles&lt;br /&gt;
|also_footer&lt;br /&gt;
|notes&lt;br /&gt;
|mode&lt;br /&gt;
|deprecated&lt;br /&gt;
|location&lt;br /&gt;
|cat1=Movement&lt;br /&gt;
|cat2=Rotation&lt;br /&gt;
|cat3=Prim&lt;br /&gt;
|cat4&lt;br /&gt;
|cat5&lt;br /&gt;
|cat6&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Viewer_coordinate_frames&amp;diff=1196826</id>
		<title>Viewer coordinate frames</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Viewer_coordinate_frames&amp;diff=1196826"/>
		<updated>2015-07-01T17:39:12Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: Fix formatting glitch (text contained something that wasn&amp;#039;t a tag in past but now it is)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Multi-lang}}&lt;br /&gt;
{{ViewerArchNav}}&lt;br /&gt;
&lt;br /&gt;
= Coordinate frames =&lt;br /&gt;
There are currently four different reference frames which are being used on the viewer.&lt;br /&gt;
Note that there are a couple of cases in the code which do NOT follow this convention on the viewer:  The rendering code uses &amp;quot;World&amp;quot; and &amp;quot;W&amp;quot; for Agent, and some of the character/joint code doesn&#039;t have a coordinate frame specified, but is specified in Agent.&lt;br /&gt;
Also, common libraries (LLCamera and LLPrimitive in particular) do NOT use this convention.  Be particularly careful when pulling values directly out of these.&lt;br /&gt;
&lt;br /&gt;
=== Global ===&lt;br /&gt;
Absolute global coordinate frame, expressed using F64&#039;s.  This is derived from the U32 x and y coords of the handles of regions, plus the region offset.  Precise enough for ~10&amp;lt;sup&amp;gt;9&amp;lt;/sup&amp;gt; regions on an edge with same precision as region-local coordinates.&lt;br /&gt;
&lt;br /&gt;
=== {{Anchor|region-local|Region}} ===&lt;br /&gt;
&#039;&#039;Also called region-local.&#039;&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
Origin is the origin of the [[Land#Region|region]] which &amp;quot;owns&amp;quot; the object.&lt;br /&gt;
&lt;br /&gt;
=== Agent ===&lt;br /&gt;
Currently, the origin is the origin of the agent&#039;s current region.  THIS DOES NOT necessarily have to be the case in the future.  This should be used only for code involving rendering (pipeline, visibility/frustum calculations)&lt;br /&gt;
&lt;br /&gt;
=== Local ===&lt;br /&gt;
Currently a catch-all for coordinate frames which are not one of the ones above.  Generally object-relative positioning.&lt;br /&gt;
&lt;br /&gt;
The local frame is used in two ways in [[LSL]]:&lt;br /&gt;
:&amp;lt;h4&amp;gt; Child Prims &amp;lt;/h4&amp;gt;&lt;br /&gt;
:Child prims (not root prims) are positioned local to the root prim; their global position and angle affected by both the root prim&#039;s rotation and position.&lt;br /&gt;
:&amp;lt;h4&amp;gt; Attachments &amp;lt;/h4&amp;gt;&lt;br /&gt;
:Objects that are attached are positioned local to the attach point; their global position and angle are affected by the position and rotation of the avatar and the playing animations{{Footnote|Playing animations don&#039;t affect the positions and rotations returned or used by LSL, they only affect how the viewer displays the position of the attachments.}}.&lt;br /&gt;
&lt;br /&gt;
= Naming conventions =&lt;br /&gt;
ALL variables/class members dealing with values in one of these coordinate frames should be post-fixed appended with the coordinate frame that it&#039;s being used in.  PLEASE do this - it greatly reduces errors.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mPositionGlobal, pos_global&lt;br /&gt;
mPositionRegion, pos_region&lt;br /&gt;
mPositionAgent, pos_agent&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Conversion functions =&lt;br /&gt;
In LLAgent and LLViewerRegion there are conversion functions for converting from one coordinate frame to the other.  They have syntax of the form getPos&amp;amp;lt;target&amp;gt;From&amp;amp;lt;source&amp;gt;() - i.e. getPosAgentFromGlobal() converts from the global coordinate frame to the agent coordinate frame.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Type conversion =&lt;br /&gt;
In order to support the high-precision global coordinates, there is a new class LLVector3d, standing for LLVector3, double precision.  It&#039;s somewhat inconsistent, but the only other alternative was renaming ALL of the math classes to use the GL style last-letter type convention, which I wasn&#039;t up to doing.&lt;br /&gt;
&lt;br /&gt;
ALL math being done in global coordinates should be done using LLVector3ds.  Currently, all functions which return global coordinates do so in LLVector3ds.  The ONLY current exception to this is audio, which I am converting to regular LLVector3s before handing them off to the audio engine - I guess this will be the case until we convert the audio engine to use agent coords.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The LLVector3d class DELIBERATELY does not have ANY form of automatic type-conversion between it and the LLVector3 class.  Since conversion back and forth isn&#039;t cheap (and potentially loses precision), you have to explicitly do a setVec() on the other class to convert back and forth.&lt;br /&gt;
&lt;br /&gt;
= Footnotes =&lt;br /&gt;
{{Footnotes}}&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Limits&amp;diff=1196609</id>
		<title>Limits</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Limits&amp;diff=1196609"/>
		<updated>2015-05-20T12:52:35Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: /* Sound */ Exactly 10 seconds&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{KBmaster}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
== Summary ==&lt;br /&gt;
{{RightToc}}&lt;br /&gt;
The Second Life Viewer and simulators have a division of labor, keeping track of the data that makes Second Life run. The Viewer&#039;s job is to:&lt;br /&gt;
&lt;br /&gt;
* Handle locations of objects.&lt;br /&gt;
* Get velocities and other physics information, and does simple physics to keep track of what is moving where.&lt;br /&gt;
&lt;br /&gt;
The simulator&#039;s job is to:&lt;br /&gt;
&lt;br /&gt;
* Run the physics engine.&lt;br /&gt;
* Detect collisions.&lt;br /&gt;
* Keep track of where everything is&lt;br /&gt;
* Send locations of content to the Viewer along with updates when certain changes occur.&lt;br /&gt;
&lt;br /&gt;
Limits are necessary for all of these components to work together. The list below outlines many of the &#039;&#039;&#039;Second Life numerical limits that affect your inworld experience&#039;&#039;&#039;. Some of these will likely change over time, so if you spot something incorrect/outdated, please take a moment to update it.&lt;br /&gt;
&lt;br /&gt;
{{KBcaution|1=The scope of this page is focused on Linden Lab&#039;s official Viewers, keeping in mind [[Third_Party_Viewer_Directory|3rd-party viewers may differ]]. Cite sources and provide substantiation for limits that aren&#039;t provided by Linden Lab. Also, unconfirmed speculation [[Talk:Limits|goes on this discussion page]]. Don&#039;t add data without a hard limit, and don&#039;t add obscure trivia that doesn&#039;t practically affect the general inworld experience.|width=80%}}&lt;br /&gt;
&lt;br /&gt;
== [[Avatar]] ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Max. # of attachments&#039;&#039;&#039; - 38 combined [[HUD]] or body attachments.&lt;br /&gt;
** They can be viewed by right-clicking your avatar and choosing &#039;&#039;&#039;Edit My Outfit&#039;&#039;&#039;.&lt;br /&gt;
** With the formal introduction of [[multiple attachments|multiple attachments to a single point]] in Viewer 2.4, you can attach up to 38 total objects, and they can all be attached to a single point. &lt;br /&gt;
* &#039;&#039;&#039;Max. # of clothing layers&#039;&#039;&#039; including alpha, tattoo, shoe base, physics, socks, gloves, undershirt, underpants, shirt, pants, jacket, skirt&lt;br /&gt;
** On viewers from before the layer limits project: 5 per slot&lt;br /&gt;
** On viewers with revised layer limits: up to 60 total, no per-slot limit. &#039;&#039;As of May 2015, this is only available in candidate viewers.&#039;&#039;&lt;br /&gt;
** In any case, only one each of shape, skin, eyes and hair base may be worn.&lt;br /&gt;
* &#039;&#039;&#039;Max Clothing Texture&#039;&#039;&#039; - 512x512 px (except 128x128 px for eyes) - Server Side Appearance (and legacy baking on outside grids) will downsize larger textures.&amp;lt;!--per Nyx Linden 9/23/2013 Content n Mesh Meeting--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Max. unassisted fly height&#039;&#039;&#039; - Stable hover at current ground elevation &#039;&#039;plus&#039;&#039; 5020m.&lt;br /&gt;
** You can easily acquire a flight attachment to fly high. Also see [[flight limit]] and [[Limits#Navigation|the Navigation section]] below.&lt;br /&gt;
* &#039;&#039;&#039;Common shoe sizes&#039;&#039;&#039; - Traditionally, most women&#039;s shoes were designed for a size 0 (zero) foot. Men&#039;s generally scale up to 14. Newer items (mesh and some sculpted) replace the system feet or conform to the avatar&#039;s shape, so adjustments may be necessary.&lt;br /&gt;
** You can check this by going to Edit menu &amp;gt; Appearance and clicking on the Shape &amp;gt; Legs tab.&lt;br /&gt;
&amp;lt;!--Can someone verify the following?&lt;br /&gt;
* &#039;&#039;&#039;Min. length of avatar name&#039;&#039;&#039; - 2 for first name, 2 for last name, 5 in total (including the space).--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Max. length of avatar name&#039;&#039;&#039; - 31 for first name, 31 for last name, 63 in total (including the space).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Max. length of {{LSLGC|Username}}&#039;&#039;&#039; - All lower case and a maximum of 63 including the &#039;.&#039;(eg; firstname.lastname)&lt;br /&gt;
**Older account user names are a combination of the First and last name in lower case separated by a period(.)(eg; lilmix.pixelmaid)&lt;br /&gt;
**Modern user names are a single name(no period)(eg; john1234) - &#039;&#039;&#039;Max.&#039;&#039;&#039; length is 31 characters&lt;br /&gt;
**The {{LSLGC|Legacy Name}}s for modern user names always shows Resident as the last name. So the Max is 40 characters in total for a new avatar&#039;s legacy name(including the space and last name &#039;Resident&#039;)&lt;br /&gt;
*&#039;&#039;&#039;Min. length of [[Display_Names]]&#039;&#039;&#039; - At least one script character&lt;br /&gt;
*&#039;&#039;&#039;Max. length of Display Names&#039;&#039;&#039; - 31 characters&lt;br /&gt;
**Display Names can include most Unicode script characters, spaces, and some punctuation.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Max. avatar speed&#039;&#039;&#039; - 250m/s (with only attachments to assist)&lt;br /&gt;
* &#039;&#039;&#039;Max. teleport speed&#039;&#039;&#039;&amp;lt;!-- - 3 teleports per 15 seconds (server 1.27.0) and 10 teleports per 15 seconds (server 1.27.1)--&amp;gt; - 10 teleports per 15 seconds, since SL server 1.27.1&lt;br /&gt;
&lt;br /&gt;
== [[Animation]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||Length of animation&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|60.0 seconds}}&lt;br /&gt;
| Limited by length or Size, whichever is reached first&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Size of Animation&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|120k bytes}}&lt;br /&gt;
| Limited by length or Size, whichever is reached first. Size is after conversion to SL [[Internal Animation Format|internal animaton format]], not BVH source which can be much larger.&lt;br /&gt;
| n/a&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||animation priority&lt;br /&gt;
| {{no|0}}&lt;br /&gt;
| {{no|4, with custom tools 6}}&lt;br /&gt;
| n/a&lt;br /&gt;
| [[Animation_Priority]]&lt;br /&gt;
|-&lt;br /&gt;
||Number of unique joints per animation&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|32}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== [http://community.secondlife.com/t5/English-Knowledge-Base/Build-Tools/ta-p/700039 Building] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||[[Prim]] dimensions&lt;br /&gt;
| {{no|&amp;lt;0.01,&amp;amp;nbsp;0.01,&amp;amp;nbsp;0.01&amp;gt;}}&lt;br /&gt;
| {{no|&amp;lt;64.0, 64.0, 64.0&amp;gt;}}&lt;br /&gt;
| Used to be &amp;lt;10.0, 10.0, 10.0&amp;gt; prior to Second Life Server version 11.08.17.238770&lt;br /&gt;
| [[llSetScale]], [[PRIM_SIZE]] and [[Megaprim]]&lt;br /&gt;
|-&lt;br /&gt;
||Number of prims in a linkset&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|256 prims}}&lt;br /&gt;
| Used to be 255 prior to Second Life Server version 1.26&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Linking distance&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|[[Linkability_Rules]]}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||[[Mesh/Mesh_physics#Physics_Resource_Cost|Physics cost]] for a physical object&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|32.0}}&lt;br /&gt;
||Additional notes:&lt;br /&gt;
* If you try to link more, it&#039;ll either say &amp;quot;Can&#039;t enable physics for objects with more than 32 primitives&amp;quot; or &amp;quot;Object has too many primitives -- its dynamics have been disabled.&amp;quot;.&lt;br /&gt;
* On server versions 1.38 and below, each sitting avatar counted as 1 prim. From 1.40.2 the limit is only on actual prims.&lt;br /&gt;
| [[OBJECT_PHYSICS_COST]]&lt;br /&gt;
|-&lt;br /&gt;
||Build or rez height&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|4096.0 meters}}&lt;br /&gt;
| 768.0 meters for Viewers prior to version 1.20&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Prim name length&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|63 bytes UTF-8 [[String|string]]}}&lt;br /&gt;
| same limit for {{LSLGC|Avatar/Name|avatar names}}, although the character set for avatar names is significantly limited.&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Prim description length&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|127 bytes UTF-8 [[String|string]]}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Temporary prims&#039; lifetime&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|up to around 60 seconds}}&lt;br /&gt;
| depends upon when the next garbage collector cycle is&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Number of temporary prims&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|RegionPrimLimit - NumberOfPrimsInRegion + Minimum(0.5*RegionPrimLimit, 1000)}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Length of hovertext&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|254 bytes UTF-8 [[String|string]]}}&lt;br /&gt;
| n/a&lt;br /&gt;
| [[llSetText]] and [[PRIM_TEXT]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== [[Communication]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||Whisper distance&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|10 meters}}&lt;br /&gt;
| &amp;lt;code&amp;gt;/whisper&amp;lt;/code&amp;gt; as the first few characters in a message can be used in viewer-2-code based viewers in local chat.&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Chat distance&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|20 meters}}&lt;br /&gt;
| text spoken as a &amp;quot;chat&amp;quot; step &#039;&#039;&#039;within gestures&#039;&#039;&#039; cannot be shouted or whispered. /whisper and /shout &#039;&#039;can&#039;&#039; be used in the &amp;quot;Replace with&amp;quot; field.&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Shout distance&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|100 meters}}&lt;br /&gt;
| &amp;lt;code&amp;gt;/shout&amp;lt;/code&amp;gt; as the first few characters in a message can be used in viewer-2-code based viewers in local chat.&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Length of a chat message and whether or not it is truncated&lt;br /&gt;
| {{no|1 byte or single-byte character}}&lt;br /&gt;
| {{no|1024 bytes or single-byte characters}}&lt;br /&gt;
| Limit does not apply to instant messages via [[llInstantMessage]] and communication between IM and email, the limit there is 1023 bytes or single-byte characters.&lt;br /&gt;
&lt;br /&gt;
The viewer-to-server communication on &#039;&#039;negative&#039;&#039; channels is truncated to 254 bytes, and on &#039;&#039;positive&#039;&#039; channels, to 1023 bytes. These limits do not affect scripts.&lt;br /&gt;
| [[llInstantMessage]]&lt;br /&gt;
|-&lt;br /&gt;
||Number of offline messages&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|Capped at 25 messages, unless the account has a Premium Subscription, in which case the cap raises to 50 messages.}}&lt;br /&gt;
| Number of offline messages (involving [[IM|IMs]], inventory offers, group notices, group invitations) received before messages get capped. Note: If autoAcceptNewInventory (debug setting) is set to TRUE (the default is FALSE), then all inventory offers, even above 25 (or 50 in the case of Premium members), go directly to inventory and do not count against the cap on offline messages. &lt;br /&gt;
| [[IM]] - [https://community.secondlife.com/t5/Featured-News/A-New-Perk-for-Premium-Subscribers/ba-p/2917357 Blog Post]&lt;br /&gt;
|-&lt;br /&gt;
||Length of a properly delivered email reply to an [[IM]]&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|1023 bytes or single-byte characters}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Time after which a reply to an [[IM]] can be sent via email.&lt;br /&gt;
| {{no|when receiving the IM via email.}}&lt;br /&gt;
| {{no|5 days after receiving the offline IM via email.}}&lt;br /&gt;
| n/a&lt;br /&gt;
| [https://blogs.secondlife.com/community/features/blog/2007/02/06/im-to-e-mail-return-addresses-changing Second Life Blogs]&lt;br /&gt;
|-&lt;br /&gt;
||Time period for which [[IM|IMs]] are stored within Second Life.&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|31 days after receiving the [[IM]]}}&lt;br /&gt;
| [[User:Torley_Linden|Torley Linden]] confirmed this with [[User:Kelly_Linden|Kelly Linden]]&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Number of [[IM|IMs]] sent by an object within an hour&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|5000 per hour}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== [[Gesture]]s ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||Shortcut key mappings&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|33 unique combinations, since {{K|F2}}&amp;amp;ndash;{{K|F12}} can be used with the {{K|Ctrl}} or {{K|Shift}} modifiers.}}&lt;br /&gt;
| n/a&lt;br /&gt;
| [[All_keyboard_shortcut_keys]] and [http://community.secondlife.com/t5/English-Knowledge-Base/Keyboard-shortcuts/ta-p/1086557 the knowledge base]&lt;br /&gt;
|-&lt;br /&gt;
||Chat step length&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|127 bytes or single-byte characters}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Wait time&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|3600 seconds (which is one hour)}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
| Maximum steps data&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|1000 bytes}} of packed data; saving with more data returns the message &amp;quot;Gesture save failed. This gesture has too many steps. Try removing some steps, then save again.&amp;quot; Shorter text, for example, will allow more steps.&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Length of included assets&lt;br /&gt;
| n/a&lt;br /&gt;
| see sections for [[#Animation|animation]], [[#Sound|sound]]&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== [[Group]]s ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of groups you can belong to:&#039;&#039;&#039; 42&lt;br /&gt;
** Roles within groups are sort of like sub-groups. In many cases, you can use them instead of creating new groups.&lt;br /&gt;
* &#039;&#039;&#039;Minimum number of members in a group:&#039;&#039;&#039; 2&lt;br /&gt;
** A group with only 1 person for 48 hours will be disbanded (cancelled). Unless the group owns land.&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of roles allowed in a group:&#039;&#039;&#039; 10 (including &amp;quot;Owners&amp;quot; and &amp;quot;Everyone&amp;quot;, which cannot be deleted)&lt;br /&gt;
* &#039;&#039;&#039;Maximum Group Name:&#039;&#039;&#039; 35 single-byte characters.&lt;br /&gt;
* &#039;&#039;&#039;Maximum Group Title:&#039;&#039;&#039; 20 single-byte characters.&lt;br /&gt;
* &#039;&#039;&#039;Maximum Length of a Group Notice:&#039;&#039;&#039; 512 single-byte characters.&lt;br /&gt;
&lt;br /&gt;
== [[Inventory]] ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of inventory items that can be sent in a folder:&#039;&#039;&#039; 42&lt;br /&gt;
** Folders count as items too. This has more to do with packet size limits than cheeky Douglas Adams references.&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of inventory items that can be contained in a prim:&#039;&#039;&#039; None, but more items increase the loading time when you open it.&lt;br /&gt;
* &#039;&#039;&#039;Maximum characters in an inventory item name:&#039;&#039;&#039; 63&lt;br /&gt;
* &#039;&#039;&#039;Maximum notecard line:&#039;&#039;&#039; None, but scripts can only read the first 255 bytes.&lt;br /&gt;
* &#039;&#039;&#039;Maximum notecard size:&#039;&#039;&#039; 65,536 bytes&lt;br /&gt;
* &#039;&#039;&#039;Number of items in the Library:&#039;&#039;&#039; 1,248 as of 2010-06-17&lt;br /&gt;
* &#039;&#039;&#039;Number of items in the Library:&#039;&#039;&#039; 2,210 as of 2012-11-04&lt;br /&gt;
** Verified by [[How_does_the_Library_work|hiding the Library]] and counting the difference.&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of inventory items displayed in a single inventory folder:&#039;&#039;&#039; Several thousand. &amp;lt;!-- not a specific item count, because the data is variable size, but still useful to document that there is a limit. --&amp;gt;&lt;br /&gt;
** This was discussed during [http://wiki.secondlife.com/wiki/Simulator_User_Group/Transcripts/2011.03.08] &amp;quot;the folder will load up to the limit number of items, and remaining ones won&#039;t show up in the viewer. you still own them, they aren&#039;t lost, but they will be hidden until the folder size is reduced.&amp;quot;&lt;br /&gt;
** There is no specified limit for total avatar inventory, very large folders can be split.&lt;br /&gt;
** There was discussion in the Third Party Developers&#039; UG (4/10/2015) meeting about new inventory and login problems from having large numbers of items in a single folder. AISv3 &#039;&#039;removed&#039;&#039; server side limits on the number of items in a folder. Flat inventories are bad. No one is certain at what number of items in a folder cause a login problem. The fix is to clear the inventory cache (not the viewer cache) and log into a deserted, empty region then move inventory items into folders and sub-folders. - The problem appears at different a number of items depending on your computer and connection speed. Hopefully being on an empty region will give one enough edge to get logged in and do some corrective work before being dropped.&lt;br /&gt;
&lt;br /&gt;
== [[Land]] ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Maximum [[Land#Parcel|parcel]] size:&#039;&#039;&#039; 65,536 meters²&lt;br /&gt;
** Covering a whole region, or square on the World Map.&lt;br /&gt;
* &#039;&#039;&#039;Minimum parcel size:&#039;&#039;&#039; 16 meters²&lt;br /&gt;
* &#039;&#039;&#039;Maximum parcel name length:&#039;&#039;&#039; 63 single-byte characters&lt;br /&gt;
* &#039;&#039;&#039;Maximum parcel description length:&#039;&#039;&#039; 255 characters&lt;br /&gt;
* &#039;&#039;&#039;Region name length:&#039;&#039;&#039; Under Linden Concierge policy, minimum of 3 characters, and a maximum of 25 characters (including spaces). See [[Linden Lab Official:Guidelines for Private Region Naming|Guidelines for Private Region Naming]].&lt;br /&gt;
** Rare exceptions exist, like [http://slurl.com/secondlife/X/128/128/24 X].&lt;br /&gt;
* &#039;&#039;&#039;Maximum ban line height for &amp;quot;no entry&amp;quot; or &amp;quot;pay to access&amp;quot;&#039;&#039;&#039; (in other words, &amp;quot;allow public access&amp;quot; is turned off, or &amp;quot;allow group access&amp;quot; is turned on, in the parcel options) is the parcel&#039;s ground elevation &#039;&#039;plus&#039;&#039; 50 meters. If a user is &#039;&#039;&#039;explicitly banned by name&#039;&#039;&#039;, the height is the parcel&#039;s ground elevation &#039;&#039;plus&#039;&#039; 5000 meters. On current viewers this is visible to the full extent.&lt;br /&gt;
* &#039;&#039;&#039;Maximum prims in a [[Land#Region|region]]:&#039;&#039;&#039;&lt;br /&gt;
** Full region: 15,000&lt;br /&gt;
** [[Land#Homestead|Homestead]]: 3,750&lt;br /&gt;
** [[Land#Openspace|Openspace]]: 750&lt;br /&gt;
* &#039;&#039;&#039;Maximum auto return value&#039;&#039;&#039;: Besides &amp;quot;0&amp;quot; (which means &#039;&#039;never&#039;&#039;), {{HoverText|999,999|Almost 23 months}} minutes is the highest auto return value.&lt;br /&gt;
* &#039;&#039;&#039;Terraforming limits:&#039;&#039;&#039;&lt;br /&gt;
** Most mainland can be raised/lowered by 4 meters (+/-).&lt;br /&gt;
** Some mainland cannot be terraformed, including: Bay City regions, Boardman, Brown, De Haro, Kama City regions, Nautilus City regions, Nova Albion regions, and Shermerville regions.&lt;br /&gt;
** [http://community.secondlife.com/t5/English-Knowledge-Base/Linden-Homes/ta-p/700103 Linden Homes] do not allow terraforming.&lt;br /&gt;
** A few, very old mainland Regions like Da Boom have a terraform range of 40 meters (+/-).&lt;br /&gt;
** Estate (private island) terraformability is settable to a maximum of 100 meters (+/-) by the estate owner or managers.&lt;br /&gt;
* &#039;&#039;&#039;Maximum water height:&#039;&#039;&#039; 100 meters using inworld controls, 255 meters by using a *.raw file upload.&lt;br /&gt;
** Region water height is usually 20 meters, and adjacent regions should have the same water height, or else they will look discontinuous.&lt;br /&gt;
* &#039;&#039;&#039;Maximum terrain height:&#039;&#039;&#039; 255 meters using inworld controls (mainland limit), 510 meters by using a *.raw file upload.&lt;br /&gt;
* &#039;&#039;&#039;Miscellaneous estate limits:&#039;&#039;&#039; You can have a maximum of 10 estate managers, 500 allowed Residents, 63 allowed groups, and 500 banned Residents.&lt;br /&gt;
** See World menu &amp;gt; Region/Estate &amp;gt; Estate tab.&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of agents&#039;&#039;&#039;&lt;br /&gt;
** Full region: 100 (Typically set to 40 on mainland, 55 on Linden Homes regions, but this does vary. Some meeting areas have this set to 60 and higher.)&lt;br /&gt;
*** Recent server performance improvements make regions with 60 agents in them perform quite well.&lt;br /&gt;
** [[Land#Homestead|Homestead]]: 20&lt;br /&gt;
** [[Land#Openspace|Openspace]]: 10&lt;br /&gt;
* &#039;&#039;&#039;Freeze Time:&#039;&#039;&#039; Land owners can [[freeze]] other Residents for up to 30 seconds.  Members of land owning groups can also be granted this ability.&lt;br /&gt;
* &#039;&#039;&#039;Minimum parcel that can be listed in Places or All search:&#039;&#039;&#039; 144 meters² &amp;lt;!-- 128 and under are disabled --&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Minimum parcel that can be listed in Events:&#039;&#039;&#039; 512 meters²&lt;br /&gt;
* &#039;&#039;&#039;Maximum altitude for event listings:&#039;&#039;&#039;  768 meters ({{JIRA|WEB-814}})&lt;br /&gt;
* &#039;&#039;&#039;Maximum heights that objects can be seen on the [[World Map]]:&#039;&#039;&#039; 400.005m&lt;br /&gt;
&lt;br /&gt;
== [[Mesh]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||Number of vertices&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|65536 vertices per LOD for each [[mesh]] - See [[Talk:Limits#Mesh_Limits|discussion page]]}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||COLLADA file size&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|Maximum mesh asset size after compression is 8 MB, roughly equivalent to a 256 MB Raw COLLADA file.}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Bone influence weights per vertex&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|4}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Number of materials per mesh&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|8}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Number of materials per face&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|1}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Physics weight for a vehicle&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|32.0}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===User Found Temporary Mesh limits:===&lt;br /&gt;
&#039;&#039;Because of an apparent bug in the importer stay within these limits.&#039;&#039;&lt;br /&gt;
* 174,752 triangles, beyond which additional triangles will appear as holes.&lt;br /&gt;
* The 64k vertices per material is pre-empted by a limit of 21,844 triangles per material, which is presently reported as {{Jira|BUG-1001}}. (4/2014 - See [[Talk:Limits#Mesh_Limits|discussion page]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:: The import process will continue making new materials beyond 8 x 21,844 (=174,752) triangles, but the extra triangles then get dropped by the limitation to 8 materials, causing holes in the resulting object. Over the 21,844 triangle limit, the vertex count will start to climb steeply, even with smooth shading, because the materials get highly interspersed. So the same vertices have to appear in multiple material lists. So the moral of the story is to stay below 21,844 triangles per material, for now, if you want to avoid some unexpected effects.&lt;br /&gt;
&lt;br /&gt;
== Misc. ==&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;[https://secondlife.com/currency/describe-limits.php Billing and Trading Limits]&#039;&#039;&#039; - Includes [https://secondlife.com/whatis/economy-market.php LindeX] currency exchange limits.&lt;br /&gt;
*&#039;&#039;&#039;Contacts in Communication &amp;gt; Friends tab &#039;&#039;&#039; - A maximum of 20 simultaneous contacts can be selected to change permissions, remove, or invite for a conference chat.&lt;br /&gt;
&lt;br /&gt;
== Navigation ==&lt;br /&gt;
&lt;br /&gt;
[[File:Max Alt.jpg|thumb|right|435px|&#039;&#039;&#039;Height counter error above 2147483647 meters&#039;&#039;&#039;]]&lt;br /&gt;
* &#039;&#039;&#039;Absolute height limit:&#039;&#039;&#039; [http://en.wikipedia.org/wiki/2147483647#2147483647_in_computing 2147483647]&amp;amp;nbsp;=&amp;amp;nbsp;2&amp;lt;sup&amp;gt;31&amp;lt;/sup&amp;gt;&amp;amp;nbsp;−&amp;amp;nbsp;1 meters, which causes the altitude counter to roll over. Altitudes well below this cause graphics errors probably due to limited floating point number precision.&lt;br /&gt;
* &#039;&#039;&#039;Highest z-value of an [[SLurl]], that will still teleport you to a positive altitude:&#039;&#039;&#039; 4096&lt;br /&gt;
** This used to be much higher, but is clamped in late model viewers.&lt;br /&gt;
&lt;br /&gt;
== [[Profile]] ==&lt;br /&gt;
&lt;br /&gt;
Each 7-bit ASCII character is encoded in one byte. International characters might need more bytes. When pasting text instead of typing, you can get in one byte more into each of the below.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;2nd Life tab&#039;s About field&#039;&#039;&#039; - 510 bytes&lt;br /&gt;
* &#039;&#039;&#039;Picks tab&#039;&#039;&#039; - 10 picks with 1022 bytes each&lt;br /&gt;
* &#039;&#039;&#039;1st Life tab&#039;s Info field&#039;&#039;&#039; - 253 bytes&lt;br /&gt;
* &#039;&#039;&#039;Classified tab&#039;&#039;&#039; - 100 listings with x bytes each&lt;br /&gt;
* &#039;&#039;&#039;My Notes&#039;&#039;&#039; - 1022 bytes&lt;br /&gt;
&lt;br /&gt;
== Performance ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Healthy Viewer FPS&#039;&#039;&#039; - Generally, FPS above 15 is good. The higher it gets, the smoother. You can check via [[Advanced]] menu &amp;gt; Performance Tools &amp;gt; Lag Meter, or for more advanced usage, see Advanced &amp;gt; Performance Tools &amp;gt; Statistics Bar.&lt;br /&gt;
* &#039;&#039;&#039;Avatar Rendering Cost scores&#039;&#039;&#039; - [[Avatar Rendering Cost|Learn all about it!]]&lt;br /&gt;
&lt;br /&gt;
== [[Scripting]] == &amp;lt;!-- Important scripting limits should be placed here, less important ones should be in the articles Caveats or Specification sections --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Height at which scripts reactivate on a no-script parcel&#039;&#039;&#039; - 50 m above terrain mesh. Scripted objects that take controls will keep running when you fly down or enter a no-script parcel. (If scripts are disabled in the region debug panel, they will not run at any height.)&lt;br /&gt;
* &#039;&#039;&#039;Maximum height where scripts can run&#039;&#039;&#039; - none, as long as the object remains rezzed or attached.&lt;br /&gt;
* &#039;&#039;&#039;Maximum script source code size&#039;&#039;&#039; - 65536 single byte characters (that&#039;s a viewer limit and can be changed in the config file &#039;panel_script_ed.xml&#039;).&lt;br /&gt;
* &#039;&#039;&#039;Maximum script memory size (LSO)&#039;&#039;&#039; - 16384 bytes.&lt;br /&gt;
* &#039;&#039;&#039;Maximum script memory size (Mono)&#039;&#039;&#039; - 65536 bytes (the maximum memory available to Mono scripts can be constrained via [[llSetMemoryLimit]]).&lt;br /&gt;
* &#039;&#039;&#039;Maximum active [[llListen|listeners]] per script&#039;&#039;&#039; - 65.&lt;br /&gt;
** &#039;&#039;&#039;Usable channel for each listener&#039;&#039;&#039; - &#039;&#039;min.&#039;&#039; -2147483648, &#039;&#039;max.&#039;&#039; 2147483647, including the following special channels: [[PUBLIC_CHANNEL]] &#039;&#039;and&#039;&#039; [[DEBUG_CHANNEL]].&lt;br /&gt;
* For specific scripting limits, look up calls in the &#039;&#039;&#039;[[LSL Portal]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== [[Sound]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||Sound length&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|10.00000 seconds (441,000 samples)}}&lt;br /&gt;
| 441,001 samples (10.00002 seconds) won&#039;t work. You&#039;re advised to cut longer sounds into 9.9-second-pieces.&lt;br /&gt;
| n/a&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== [[Textures]] ==&lt;br /&gt;
* &#039;&#039;&#039;[http://en.wikipedia.org/wiki/Aspect_ratio Aspect ratios]&#039;&#039;&#039; of profile, place, etc. pictures — all of these were measured at UI size (Edit menu &amp;gt; Preferences &amp;gt; General tab &amp;gt; UI Size) = 1.000:&lt;br /&gt;
&lt;br /&gt;
=== Second Life Viewer 3.6 ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Classifieds thumbnail&#039;&#039;&#039; - ~3:2 (101&amp;amp;times;69 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Classifieds expanded&#039;&#039;&#039; - ~4:3 (159&amp;amp;times;120 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Classifieds expanded &amp;gt; More Info&#039;&#039;&#039; - native aspect ratio&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Destination Guide thumbnail&#039;&#039;&#039; - ~3:2 (101&amp;amp;times;69 pixels) &lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Destination Guide expanded&#039;&#039;&#039; - ~4:3 (159&amp;amp;times;120 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; People&#039;&#039;&#039; - 1:1 (100&amp;amp;times;100 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Places expanded&#039;&#039;&#039; ~4:3 (159&amp;amp;times;120 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Place Profile&#039;&#039;&#039; - ~3:2 (290&amp;amp;times;197 pixels)&lt;br /&gt;
* &#039;&#039;&#039;About Land &amp;gt; Options tab&#039;&#039;&#039; - ~4:3 (195&amp;amp;times;150 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Picture&#039;&#039;&#039; - native aspect ratio; thumbnail cropped to 72&amp;amp;times;72 pixels; zoomed uncropped up to 300&amp;amp;times;300 pixels&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Real world picture&#039;&#039;&#039; - native aspect ratio; thumbnail cropped to 45&amp;amp;times;45 pixels; zoomed uncropped up to 300&amp;amp;times;300 pixels&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Picks thumbnail&#039;&#039;&#039; - 4:3 (60&amp;amp;times;45 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Pick expanded&#039;&#039;&#039; - 4:3 (320&amp;amp;times;240 pixels)&lt;br /&gt;
&lt;br /&gt;
=== 1.x Series Viewers ===&lt;br /&gt;
(official Viewer up to 1.23.5, still used by some [[Alternate viewers|Third Party Viewers]])&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; All for &amp;quot;Classifieds&amp;quot;, &amp;quot;People&amp;quot;, and &amp;quot;Places&amp;quot;&#039;&#039;&#039; - 4:3 (256&amp;amp;times;192 pi&amp;amp;times;els)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Places and Classified tabs&#039;&#039;&#039; - ~7:5 (398&amp;amp;times;282 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Land tab&#039;&#039;&#039; - ~7:5 (358&amp;amp;times;252 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; 2nd Life tab&#039;&#039;&#039; - ~4:3 (178&amp;amp;times;133 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Picks tab&#039;&#039;&#039; - 16:9 (288&amp;amp;times;162 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; 1st Life tab&#039;&#039;&#039; - 1:1 (133&amp;amp;times;133 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Classifieds tab&#039;&#039;&#039; - ~3:2 (206&amp;amp;times;137 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Web tab&#039;&#039;&#039; - 1:1 (400&amp;amp;times;400 pixels)&lt;br /&gt;
** A scrollbar uses 15 pixels on the right-hand side.&lt;br /&gt;
* &#039;&#039;&#039;About Land &amp;gt; Options tab&#039;&#039;&#039; - ~3:2 (178&amp;amp;times;117 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Group Information &amp;gt; General tab&#039;s &amp;quot;Group Insignia&amp;quot;&#039;&#039;&#039; - 1:1 (126&amp;amp;times;126 pixels)&lt;br /&gt;
** Some of these textures are shared (for example, Search &amp;gt; All place pages, Search &amp;gt; Places, and About Land &amp;gt; Options use the same image), so you should pick a well-balanced ratio and size.&lt;br /&gt;
** [[Texture_aspect_ratios|Learn how to get correct texture aspect ratios when editing images.]]&lt;br /&gt;
&lt;br /&gt;
=== All Viewers ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Maximum texture size&#039;&#039;&#039; - 1024&amp;amp;times;1024 pixels&lt;br /&gt;
** All Second Life textures are constrained to [http://en.wikipedia.org/wiki/Power_of_2 powers of 2] (e.g., 128, 256, 512).&lt;br /&gt;
** Some textures inworld have a resolution as high as 2048&amp;amp;times;2048; this is due to a previous limit that was higher.&lt;br /&gt;
** We strongly recommend you use as small textures as possible because larger ones consume more memory and take substantially longer to load.&lt;br /&gt;
** Where large textures are being forced by import to only 512&amp;amp;times;512, lower your ...&amp;gt; Preferences &amp;gt;...&amp;gt; UI Size under 1.0, to increase import size to the max 1024&amp;amp;times;1024.&lt;br /&gt;
&lt;br /&gt;
[[Category:Creation]] [[Category:Tutorials]] [[Category:Lists]]&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
In general 1 byte is enough to contain one character.&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlSetPrimMediaParams/Tricks&amp;diff=1196494</id>
		<title>LlSetPrimMediaParams/Tricks</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlSetPrimMediaParams/Tricks&amp;diff=1196494"/>
		<updated>2015-05-13T11:41:01Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: Last missing tag&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Shared Media and HTTP-In ==&lt;br /&gt;
{{Warning|While these tricks are still useful, they are largely unneeded now with [[llSetContentType]] and [[CONTENT_TYPE_HTML]]}}&lt;br /&gt;
&lt;br /&gt;
Pre-Viewer 2.0 interfacing with an LSL script is a jumble of llDialog, chats, touches and possibly external web sites.  With Shared Media that all changes.&lt;br /&gt;
&lt;br /&gt;
One step at a time .......&lt;br /&gt;
=== llSetPrimMediaParams ===&lt;br /&gt;
* Use llSetPrimMediaParams to set the url and various parameters on the face of a prim via LSL.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt; &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetPrimMediaParams(0,                             // Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,                     // Show this page immediately&lt;br /&gt;
             PRIM_MEDIA_CURRENT_URL,&amp;quot;http://google.com&amp;quot;,    // The url currently showing&lt;br /&gt;
             PRIM_MEDIA_HOME_URL,&amp;quot;http://google.com&amp;quot;,       // The url if they hit &#039;home&#039;&lt;br /&gt;
             PRIM_MEDIA_HEIGHT_PIXELS,512,                  // Height/width of media texture will be&lt;br /&gt;
             PRIM_MEDIA_WIDTH_PIXELS,512]);                 //   rounded up to nearest power of 2.&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== data: urls ===&lt;br /&gt;
There is a special url type: &amp;quot;data:&amp;quot; that lets you send the html &#039;&#039;in the url&#039;&#039;.  Paste the below into your browser&#039;s address bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data:text/html,&amp;lt;h1&amp;gt;This is a test&amp;lt;/h1&amp;gt;&amp;lt;h2&amp;gt;This is a test&amp;lt;/h2&amp;gt;&amp;lt;h3&amp;gt;This is a test&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== llSetPrimMediaParams for data: urls ===&lt;br /&gt;
* Thus you can build arbitrary html in your LSL script and display it on the face of the prim&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
show(string html)&lt;br /&gt;
{&lt;br /&gt;
    html = &amp;quot;data:text/html,&amp;quot; + llEscapeURL(html);&lt;br /&gt;
    llSetPrimMediaParams(0,                  // Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,      // Show this page immediately&lt;br /&gt;
             PRIM_MEDIA_CURRENT_URL,html,    // The url currently showing&lt;br /&gt;
             PRIM_MEDIA_HOME_URL,html,       // The url if they hit &#039;home&#039;&lt;br /&gt;
             PRIM_MEDIA_HEIGHT_PIXELS,512,   // Height/width of media texture will be&lt;br /&gt;
             PRIM_MEDIA_WIDTH_PIXELS,512]);  //   rounded up to nearest power of 2.&lt;br /&gt;
}&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        show(&amp;quot;&amp;lt;h1&amp;gt;This is a test&amp;lt;/h1&amp;gt;&amp;lt;h2&amp;gt;This is a test&amp;lt;/h2&amp;gt;&amp;lt;h3&amp;gt;This is a test&amp;lt;/h3&amp;gt;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HTTP-In ===&lt;br /&gt;
* Scripts can become web servers via HTTP-In&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llRequestURL();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    http_request(key id, string method, string body)&lt;br /&gt;
    {&lt;br /&gt;
        if (method == URL_REQUEST_GRANTED)&lt;br /&gt;
        {&lt;br /&gt;
            llSay(0,&amp;quot;URL is: &amp;quot; + body);&lt;br /&gt;
        }&lt;br /&gt;
        else if (method == &amp;quot;GET&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llSay(0,&amp;quot;Received page request.&amp;quot;);&lt;br /&gt;
            llHTTPResponse(id,200,&amp;quot;OK&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== llSetPrimMediaParams for data: urls that link back to HTTP-In ===&lt;br /&gt;
* Which means you can make web pages that trigger other page views via http-in links&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
show(string html)&lt;br /&gt;
{&lt;br /&gt;
    html = &amp;quot;data:text/html,&amp;quot; + llEscapeURL(html);&lt;br /&gt;
    llSetPrimMediaParams(0,                  // Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,      // Show this page immediately&lt;br /&gt;
             PRIM_MEDIA_CURRENT_URL,html,    // The url currently showing&lt;br /&gt;
             PRIM_MEDIA_HOME_URL,html,       // The url if they hit &#039;home&#039;&lt;br /&gt;
             PRIM_MEDIA_HEIGHT_PIXELS,512,   // Height/width of media texture will be&lt;br /&gt;
             PRIM_MEDIA_WIDTH_PIXELS,512]);  //   rounded up to nearest power of 2.&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string replace_all(string src, string target, string replace)&lt;br /&gt;
{&lt;br /&gt;
    return llDumpList2String(llParseString2List(src,[target],[]),replace);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string get_query(key id, string name)&lt;br /&gt;
{&lt;br /&gt;
    string query = llGetHTTPHeader(id,&amp;quot;x-query-string&amp;quot;);&lt;br /&gt;
    query = replace_all(query,&amp;quot;+&amp;quot;,&amp;quot; &amp;quot;);&lt;br /&gt;
    query = llUnescapeURL(query);&lt;br /&gt;
    list q = llParseString2List(query,[&amp;quot;=&amp;quot;,&amp;quot;&amp;amp;&amp;quot;,&amp;quot;;&amp;quot;],[]);&lt;br /&gt;
    integer i = llListFindList(q,[name]);&lt;br /&gt;
    if (i != -1)&lt;br /&gt;
    {&lt;br /&gt;
        return llList2String(q,i+1);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    return &amp;quot;&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        show(&amp;quot;&amp;lt;h1&amp;gt;This is a test&amp;lt;/h1&amp;gt;&amp;lt;h2&amp;gt;This is a test&amp;lt;/h2&amp;gt;&amp;lt;h3&amp;gt;This is a test&amp;lt;/h3&amp;gt;&amp;quot;);&lt;br /&gt;
        llRequestURL();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    http_request(key id, string method, string body)&lt;br /&gt;
    {&lt;br /&gt;
        if (method == URL_REQUEST_GRANTED)&lt;br /&gt;
        {&lt;br /&gt;
            show(&amp;quot;&amp;lt;h1&amp;gt;&amp;lt;a href=&#039;&amp;quot; + body + &amp;quot;/?get=owner&#039;&amp;gt;Owner ID&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;a href=&#039;&amp;quot; + body + &amp;quot;/?get=object&#039;&amp;gt;Object ID&amp;lt;/a&amp;gt;&amp;lt;/h1&amp;gt;&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else if (method == &amp;quot;GET&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            string get = get_query(id,&amp;quot;get&amp;quot;);&lt;br /&gt;
            if (get == &amp;quot;owner&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                llHTTPResponse(id,200,&amp;quot;Owner is: &amp;quot; + (string)llGetOwner());&lt;br /&gt;
            }&lt;br /&gt;
            else if (get == &amp;quot;object&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                llHTTPResponse(id,200,&amp;quot;Object is: &amp;quot; + (string)llGetKey());&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {            &lt;br /&gt;
                llHTTPResponse(id,400,&amp;quot;huh?&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Forms ===&lt;br /&gt;
* You can put forms in data: urls&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data:text/html,&amp;lt;form action=&amp;quot;http://google.com/search&amp;quot; method=&amp;quot;GET&amp;quot;&amp;gt;Search:&amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;q&amp;quot;&amp;gt;&amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Submit&amp;quot;&amp;gt;&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Magic ===&lt;br /&gt;
* You can set the script HTTP-In url as the form action to get the results of the form sent back to the script&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
string html_base = &lt;br /&gt;
&amp;quot;&amp;lt;h1&amp;gt;&amp;lt;form action=&#039;%url%&#039; method=&#039;GET&#039;&amp;gt;&lt;br /&gt;
Floating Text:&amp;lt;input type=&#039;text&#039; name=&#039;text&#039;&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;input type=&#039;submit&#039; value=&#039;Set&#039;&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&amp;lt;/h1&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
string url;&lt;br /&gt;
&lt;br /&gt;
integer r;&lt;br /&gt;
show(string html)&lt;br /&gt;
{&lt;br /&gt;
    html = &amp;quot;data:text/html,&amp;quot; + llEscapeURL(html) + &amp;quot;&amp;lt;span &amp;quot; + (string)((++r) % 10) + &amp;quot;/&amp;gt;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    llSetPrimMediaParams(0,                  // Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,      // Show this page immediately&lt;br /&gt;
             PRIM_MEDIA_CURRENT_URL,html,    // The url currently showing&lt;br /&gt;
             PRIM_MEDIA_HOME_URL,html,       // The url if they hit &#039;home&#039;&lt;br /&gt;
             PRIM_MEDIA_HEIGHT_PIXELS,512,   // Height/width of media texture will be&lt;br /&gt;
             PRIM_MEDIA_WIDTH_PIXELS,512]);  //   rounded up to nearest power of 2.&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string replace_all(string src, string target, string replace)&lt;br /&gt;
{&lt;br /&gt;
    return llDumpList2String(llParseString2List(src,[target],[]),replace);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string get_query(key id, string name)&lt;br /&gt;
{&lt;br /&gt;
    string query = llGetHTTPHeader(id,&amp;quot;x-query-string&amp;quot;);&lt;br /&gt;
    query = replace_all(query,&amp;quot;+&amp;quot;,&amp;quot; &amp;quot;);&lt;br /&gt;
    query = llUnescapeURL(query);&lt;br /&gt;
    list q = llParseString2List(query,[&amp;quot;=&amp;quot;,&amp;quot;&amp;amp;&amp;quot;,&amp;quot;;&amp;quot;],[]);&lt;br /&gt;
    integer i = llListFindList(q,[name]);&lt;br /&gt;
    if (i != -1)&lt;br /&gt;
    {&lt;br /&gt;
        return llList2String(q,i+1);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    return &amp;quot;&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llRequestURL();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    http_request(key id, string method, string body)&lt;br /&gt;
    {&lt;br /&gt;
        if (method == URL_REQUEST_GRANTED)&lt;br /&gt;
        {&lt;br /&gt;
            url = body + &amp;quot;/&amp;quot;;&lt;br /&gt;
            &lt;br /&gt;
            show(replace_all(html_base,&amp;quot;%url%&amp;quot;,url));&lt;br /&gt;
        }&lt;br /&gt;
        else if (method == &amp;quot;GET&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llSetText(get_query(id,&amp;quot;text&amp;quot;),&amp;lt;1,1,0&amp;gt;,1);&lt;br /&gt;
            show(replace_all(html_base,&amp;quot;%url%&amp;quot;,url));&lt;br /&gt;
            llHTTPResponse(id,200,&amp;quot;Loading....&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The Limits ===&lt;br /&gt;
* 1024 bytes per url&lt;br /&gt;
* llEscapeURLs means non-alphanumeric characters are 3 bytes (ouch)&lt;br /&gt;
** I&#039;m actually not clear on if this is really needed.  I seem to sometimes get blank pages if I don&#039;t but some pages render fine with out it.  Maybe there is a subset of symbols that must be escaped and escaping only those would ease some of the space constraints?&lt;br /&gt;
* Must force another page view after form submission since HTTP-In can&#039;t generate HTML&lt;br /&gt;
* No real way of knowing which avatar is interacting with the HTML&lt;br /&gt;
&lt;br /&gt;
=== The Tricks ===&lt;br /&gt;
* &amp;lt;base href=&amp;quot;&amp;lt;http-in-url&amp;gt;/&amp;quot;&amp;gt;&lt;br /&gt;
** HTTP-In urls are long, especially if escaped.  In a page that includes more than a single link back to the script, or more than a single form, this can save a lot of space.&lt;br /&gt;
* Tiny urls&lt;br /&gt;
** You can use url shortening services to create short links to long data urls.  In theory this should let you get past the 1k limit quite nicely, however there is overhead in setting up the tiny url.&lt;br /&gt;
=== The future? ===&lt;br /&gt;
I think there is a lot more potential here than what I have outlined .... if you have ideas or work out great new hacks let me know!  Also let me know if it is ok to share those hacks with others. :)&lt;br /&gt;
* svg?&lt;br /&gt;
* javascript?&lt;br /&gt;
* ajax?&lt;br /&gt;
&lt;br /&gt;
=== DHTML / Javascript (Tali Rosca) ===&lt;br /&gt;
Tali Rosca sent me the code to render the output of HTTP-In directly. I&#039;ve wrapped her magic into the build_url and build_response functions in the example below.  This example renders a page that is around 3.5k bytes - well past the 1k limit of urls.&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Pros&#039;&#039;&#039;:&lt;br /&gt;
* Navigation is much smoother and feels more natural&lt;br /&gt;
* Only limited by script memory&lt;br /&gt;
&#039;&#039;&#039;Cons&#039;&#039;&#039;:  &lt;br /&gt;
* Links are extremely large: 296 bytes for a link to just the base http-in url.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
string url; // Our base http-in url&lt;br /&gt;
integer r;  // Used for uniqueness in PrimMedia urls&lt;br /&gt;
integer page;  // The page number.&lt;br /&gt;
&lt;br /&gt;
show(string html)&lt;br /&gt;
{&lt;br /&gt;
    html += &amp;quot;&amp;lt;span &amp;quot; + (string)((++r) % 10) + &amp;quot;/&amp;gt;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    llSetPrimMediaParams(0,                  // Side to display the media on.&lt;br /&gt;
            [PRIM_MEDIA_AUTO_PLAY,TRUE,      // Show this page immediately&lt;br /&gt;
             PRIM_MEDIA_CURRENT_URL,html,    // The url if they hit &#039;home&#039;&lt;br /&gt;
             PRIM_MEDIA_HOME_URL,html,       // The url currently showing&lt;br /&gt;
             PRIM_MEDIA_HEIGHT_PIXELS,512,   // Height/width of media texture will be&lt;br /&gt;
             PRIM_MEDIA_WIDTH_PIXELS,512]);  //   rounded up to nearest power of 2.&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// This creates a data: url that will render the output of the http-in url &lt;br /&gt;
// given.&lt;br /&gt;
string build_url(string url)&lt;br /&gt;
{&lt;br /&gt;
    return &amp;quot;data:text/html,&amp;quot; &lt;br /&gt;
        + llEscapeURL(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;script src=&#039;&amp;quot; + url &lt;br /&gt;
        + &amp;quot;&#039; type=&#039;text/javascript&#039;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body onload=&#039;init()&#039;&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// This wraps the html you want to display so that it will be shown from links &lt;br /&gt;
// made with build_url&lt;br /&gt;
string build_response(string body)&lt;br /&gt;
{&lt;br /&gt;
    return &amp;quot;function init() {document.getElementsByTagName(&#039;body&#039;)[0].innerHTML=&#039;&amp;quot; + body + &amp;quot;&#039;;}&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llRequestURL();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    http_request(key id, string method, string body)&lt;br /&gt;
    {&lt;br /&gt;
        if (method == URL_REQUEST_GRANTED)&lt;br /&gt;
        {&lt;br /&gt;
            url = body + &amp;quot;/&amp;quot;;&lt;br /&gt;
            &lt;br /&gt;
            show(build_url(url + &amp;quot;page&amp;quot; + (string)(page)));&lt;br /&gt;
        }&lt;br /&gt;
        else if (method == &amp;quot;GET&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            string path = llGetHTTPHeader(id,&amp;quot;x-path-info&amp;quot;);&lt;br /&gt;
            string content = &amp;quot;&amp;lt;h1&amp;gt;path: &amp;quot; + path + &amp;quot;&amp;lt;/h1&amp;gt;&amp;quot;;&lt;br /&gt;
            page = (integer)llGetSubString(path,5,5);&lt;br /&gt;
            if (page &amp;gt; 0) content += &amp;quot;&amp;lt;a href=\&amp;quot;&amp;quot; + build_url(url + &amp;quot;page&amp;quot; + (string)(page - 1)) + &amp;quot;\&amp;quot;&amp;gt;Previous&amp;lt;/a&amp;gt; &amp;quot;;&lt;br /&gt;
            if (page &amp;lt; 9) content += &amp;quot;&amp;lt;a href=\&amp;quot;&amp;quot; + build_url(url + &amp;quot;page&amp;quot; + (string)(page + 1)) + &amp;quot;\&amp;quot;&amp;gt;Next&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&amp;quot;;&lt;br /&gt;
            integer k;&lt;br /&gt;
            for(;k&amp;lt;10;++k)&lt;br /&gt;
            {&lt;br /&gt;
                if (k == page)&lt;br /&gt;
                    content += &amp;quot;&amp;lt;br&amp;gt;Page &amp;quot; + (string)k;&lt;br /&gt;
                else&lt;br /&gt;
                    content += &amp;quot;&amp;lt;br&amp;gt;&amp;lt;a href=\&amp;quot;&amp;quot; + build_url(url + &amp;quot;page&amp;quot; + (string)(k)) + &amp;quot;\&amp;quot;&amp;gt;Page &amp;quot; + (string)k + &amp;quot;&amp;lt;/a&amp;gt;&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            content += &amp;quot;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;This page is &amp;quot; + (string)(llStringLength(build_response(content)) + 37) + &amp;quot; bytes long.&amp;quot;;&lt;br /&gt;
            llHTTPResponse(id,200,build_response(content));&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* I&#039;m not quite sure if it is possible to hook up a form using this method. Ideas?&lt;br /&gt;
&lt;br /&gt;
=== Another javascript boot strapping method (Vegas Silverweb) ===&lt;br /&gt;
This one makes it pretty easy to build out some arbitrary length web pages, using http-in&#039;s output directly. Loading between pages is kinda slow.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
string URL;&lt;br /&gt;
&lt;br /&gt;
string get(string page)&lt;br /&gt;
{&lt;br /&gt;
    if (page == &amp;quot;index&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;quot;&amp;lt;h1&amp;gt;Index&amp;lt;/h1&amp;gt;This is the index page.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;a href=&#039;page1.html&#039;&amp;gt;Link to page 1&amp;lt;/a&amp;gt;&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    else if (page == &amp;quot;page1&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        return &amp;quot;&amp;lt;h1&amp;gt;Page 1&amp;lt;/h1&amp;gt;This is page 1!.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;a href =&#039;index.html&#039;&amp;gt;Link to the index page.&amp;lt;/a&amp;gt;&amp;quot;;   &lt;br /&gt;
    }&lt;br /&gt;
    else return &amp;quot;Unknown page.&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string serve(string page)&lt;br /&gt;
{&lt;br /&gt;
    return &amp;quot;document.write(atob(&#039;&amp;quot;+llStringToBase64(get(page))+&amp;quot;&#039;));&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer R;&lt;br /&gt;
load(string page)&lt;br /&gt;
{&lt;br /&gt;
    string content=&amp;quot;data:text/html;base64,&amp;quot;&lt;br /&gt;
        +llStringToBase64(&amp;quot;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;base href=&#039;&amp;quot;+URL+&amp;quot;/&#039;&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;quot;+&lt;br /&gt;
                        &amp;quot;&amp;lt;script src=&#039;&amp;quot;+page+&amp;quot;.js&#039; type=&#039;text/javascript&#039;&amp;gt;&amp;quot;+&lt;br /&gt;
                        &amp;quot;&amp;lt;/script&amp;gt;&amp;lt;span r=&#039;&amp;quot;+(string)(++R%10)+&amp;quot;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    llSetPrimMediaParams(0,[&lt;br /&gt;
                    PRIM_MEDIA_CURRENT_URL,content,&lt;br /&gt;
                    PRIM_MEDIA_HOME_URL,content,&lt;br /&gt;
                    PRIM_MEDIA_AUTO_ZOOM,FALSE,&lt;br /&gt;
                    PRIM_MEDIA_FIRST_CLICK_INTERACT,TRUE,&lt;br /&gt;
                    PRIM_MEDIA_PERMS_INTERACT,PRIM_MEDIA_PERM_ANYONE,&lt;br /&gt;
                    PRIM_MEDIA_PERMS_CONTROL,PRIM_MEDIA_PERM_NONE,&lt;br /&gt;
                    PRIM_MEDIA_AUTO_PLAY,TRUE&lt;br /&gt;
                    ]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llRequestURL();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    http_request(key id, string method, string body)&lt;br /&gt;
    {&lt;br /&gt;
        if (method == URL_REQUEST_GRANTED)&lt;br /&gt;
        {&lt;br /&gt;
            URL = body;&lt;br /&gt;
            load(&amp;quot;index&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else if (method == URL_REQUEST_DENIED)&lt;br /&gt;
        {&lt;br /&gt;
            llOwnerSay(&amp;quot;Unable to get url!&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        else if (method == &amp;quot;GET&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            string path_raw = llGetHTTPHeader(id,&amp;quot;x-path-info&amp;quot;);&lt;br /&gt;
            if (path_raw == &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                // No path, assume index.html&lt;br /&gt;
                path_raw = &amp;quot;/index.html&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            &lt;br /&gt;
            list path = llParseString2List(llGetSubString(path_raw,1,-1),[&amp;quot;.&amp;quot;],[]);&lt;br /&gt;
            string page = llList2String(path,0);&lt;br /&gt;
            string type = llList2String(path,1);&lt;br /&gt;
            &lt;br /&gt;
            if (type == &amp;quot;js&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                llHTTPResponse(id,200,serve(page));&lt;br /&gt;
            }&lt;br /&gt;
            else if (type == &amp;quot;html&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                llHTTPResponse(id,100,&amp;quot;&amp;quot;);&lt;br /&gt;
                load(page);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
[[Category:Shared Media]]&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Limits&amp;diff=1196449</id>
		<title>Limits</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Limits&amp;diff=1196449"/>
		<updated>2015-05-09T19:28:44Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: /* Communication */ Formatting screwup&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{KBmaster}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
== Summary ==&lt;br /&gt;
{{RightToc}}&lt;br /&gt;
The Second Life Viewer and simulators have a division of labor, keeping track of the data that makes Second Life run. The Viewer&#039;s job is to:&lt;br /&gt;
&lt;br /&gt;
* Handle locations of objects.&lt;br /&gt;
* Get velocities and other physics information, and does simple physics to keep track of what is moving where.&lt;br /&gt;
&lt;br /&gt;
The simulator&#039;s job is to:&lt;br /&gt;
&lt;br /&gt;
* Run the physics engine.&lt;br /&gt;
* Detect collisions.&lt;br /&gt;
* Keep track of where everything is&lt;br /&gt;
* Send locations of content to the Viewer along with updates when certain changes occur.&lt;br /&gt;
&lt;br /&gt;
Limits are necessary for all of these components to work together. The list below outlines many of the &#039;&#039;&#039;Second Life numerical limits that affect your inworld experience&#039;&#039;&#039;. Some of these will likely change over time, so if you spot something incorrect/outdated, please take a moment to update it.&lt;br /&gt;
&lt;br /&gt;
{{KBcaution|1=The scope of this page is focused on Linden Lab&#039;s official Viewers, keeping in mind [[Third_Party_Viewer_Directory|3rd-party viewers may differ]]. Cite sources and provide substantiation for limits that aren&#039;t provided by Linden Lab. Also, unconfirmed speculation [[Talk:Limits|goes on this discussion page]]. Don&#039;t add data without a hard limit, and don&#039;t add obscure trivia that doesn&#039;t practically affect the general inworld experience.|width=80%}}&lt;br /&gt;
&lt;br /&gt;
== [[Avatar]] ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Max. # of attachments&#039;&#039;&#039; - 38 combined [[HUD]] or body attachments.&lt;br /&gt;
** They can be viewed by right-clicking your avatar and choosing &#039;&#039;&#039;Edit My Outfit&#039;&#039;&#039;.&lt;br /&gt;
** With the formal introduction of [[multiple attachments|multiple attachments to a single point]] in Viewer 2.4, you can attach up to 38 total objects, and they can all be attached to a single point. &lt;br /&gt;
* &#039;&#039;&#039;Max. # of clothing layers&#039;&#039;&#039; including alpha, tattoo, shoe base, physics, socks, gloves, undershirt, underpants, shirt, pants, jacket, skirt&lt;br /&gt;
** On viewers from before the layer limits project: 5 per slot&lt;br /&gt;
** On viewers with revised layer limits: up to 60 total, no per-slot limit. &#039;&#039;As of May 2015, this is only available in candidate viewers.&#039;&#039;&lt;br /&gt;
** In any case, only one each of shape, skin, eyes and hair base may be worn.&lt;br /&gt;
* &#039;&#039;&#039;Max Clothing Texture&#039;&#039;&#039; - 512x512 px (except 128x128 px for eyes) - Server Side Appearance (and legacy baking on outside grids) will downsize larger textures.&amp;lt;!--per Nyx Linden 9/23/2013 Content n Mesh Meeting--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Max. unassisted fly height&#039;&#039;&#039; - Stable hover at current ground elevation &#039;&#039;plus&#039;&#039; 5020m.&lt;br /&gt;
** You can easily acquire a flight attachment to fly high. Also see [[flight limit]] and [[Limits#Navigation|the Navigation section]] below.&lt;br /&gt;
* &#039;&#039;&#039;Common shoe sizes&#039;&#039;&#039; - Traditionally, most women&#039;s shoes were designed for a size 0 (zero) foot. Men&#039;s generally scale up to 14. Newer items (mesh and some sculpted) replace the system feet or conform to the avatar&#039;s shape, so adjustments may be necessary.&lt;br /&gt;
** You can check this by going to Edit menu &amp;gt; Appearance and clicking on the Shape &amp;gt; Legs tab.&lt;br /&gt;
&amp;lt;!--Can someone verify the following?&lt;br /&gt;
* &#039;&#039;&#039;Min. length of avatar name&#039;&#039;&#039; - 2 for first name, 2 for last name, 5 in total (including the space).--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Max. length of avatar name&#039;&#039;&#039; - 31 for first name, 31 for last name, 63 in total (including the space).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Max. length of {{LSLGC|Username}}&#039;&#039;&#039; - All lower case and a maximum of 63 including the &#039;.&#039;(eg; firstname.lastname)&lt;br /&gt;
**Older account user names are a combination of the First and last name in lower case separated by a period(.)(eg; lilmix.pixelmaid)&lt;br /&gt;
**Modern user names are a single name(no period)(eg; john1234) - &#039;&#039;&#039;Max.&#039;&#039;&#039; length is 31 characters&lt;br /&gt;
**The {{LSLGC|Legacy Name}}s for modern user names always shows Resident as the last name. So the Max is 40 characters in total for a new avatar&#039;s legacy name(including the space and last name &#039;Resident&#039;)&lt;br /&gt;
*&#039;&#039;&#039;Min. length of [[Display_Names]]&#039;&#039;&#039; - At least one script character&lt;br /&gt;
*&#039;&#039;&#039;Max. length of Display Names&#039;&#039;&#039; - 31 characters&lt;br /&gt;
**Display Names can include most Unicode script characters, spaces, and some punctuation.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Max. avatar speed&#039;&#039;&#039; - 250m/s (with only attachments to assist)&lt;br /&gt;
* &#039;&#039;&#039;Max. teleport speed&#039;&#039;&#039;&amp;lt;!-- - 3 teleports per 15 seconds (server 1.27.0) and 10 teleports per 15 seconds (server 1.27.1)--&amp;gt; - 10 teleports per 15 seconds, since SL server 1.27.1&lt;br /&gt;
&lt;br /&gt;
== [[Animation]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||Length of animation&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|60.0 seconds}}&lt;br /&gt;
| Limited by length or Size, whichever is reached first&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Size of Animation&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|120k bytes}}&lt;br /&gt;
| Limited by length or Size, whichever is reached first. Size is after conversion to SL [[Internal Animation Format|internal animaton format]], not BVH source which can be much larger.&lt;br /&gt;
| n/a&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||animation priority&lt;br /&gt;
| {{no|0}}&lt;br /&gt;
| {{no|4, with custom tools 6}}&lt;br /&gt;
| n/a&lt;br /&gt;
| [[Animation_Priority]]&lt;br /&gt;
|-&lt;br /&gt;
||Number of unique joints per animation&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|32}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== [http://community.secondlife.com/t5/English-Knowledge-Base/Build-Tools/ta-p/700039 Building] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||[[Prim]] dimensions&lt;br /&gt;
| {{no|&amp;lt;0.01,&amp;amp;nbsp;0.01,&amp;amp;nbsp;0.01&amp;gt;}}&lt;br /&gt;
| {{no|&amp;lt;64.0, 64.0, 64.0&amp;gt;}}&lt;br /&gt;
| Used to be &amp;lt;10.0, 10.0, 10.0&amp;gt; prior to Second Life Server version 11.08.17.238770&lt;br /&gt;
| [[llSetScale]], [[PRIM_SIZE]] and [[Megaprim]]&lt;br /&gt;
|-&lt;br /&gt;
||Number of prims in a linkset&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|256 prims}}&lt;br /&gt;
| Used to be 255 prior to Second Life Server version 1.26&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Linking distance&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|[[Linkability_Rules]]}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||[[Mesh/Mesh_physics#Physics_Resource_Cost|Physics cost]] for a physical object&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|32.0}}&lt;br /&gt;
||Additional notes:&lt;br /&gt;
* If you try to link more, it&#039;ll either say &amp;quot;Can&#039;t enable physics for objects with more than 32 primitives&amp;quot; or &amp;quot;Object has too many primitives -- its dynamics have been disabled.&amp;quot;.&lt;br /&gt;
* On server versions 1.38 and below, each sitting avatar counted as 1 prim. From 1.40.2 the limit is only on actual prims.&lt;br /&gt;
| [[OBJECT_PHYSICS_COST]]&lt;br /&gt;
|-&lt;br /&gt;
||Build or rez height&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|4096.0 meters}}&lt;br /&gt;
| 768.0 meters for Viewers prior to version 1.20&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Prim name length&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|63 bytes UTF-8 [[String|string]]}}&lt;br /&gt;
| same limit for {{LSLGC|Avatar/Name|avatar names}}, although the character set for avatar names is significantly limited.&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Prim description length&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|127 bytes UTF-8 [[String|string]]}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Temporary prims&#039; lifetime&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|up to around 60 seconds}}&lt;br /&gt;
| depends upon when the next garbage collector cycle is&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Number of temporary prims&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|RegionPrimLimit - NumberOfPrimsInRegion + Minimum(0.5*RegionPrimLimit, 1000)}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Length of hovertext&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|254 bytes UTF-8 [[String|string]]}}&lt;br /&gt;
| n/a&lt;br /&gt;
| [[llSetText]] and [[PRIM_TEXT]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== [[Communication]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||Whisper distance&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|10 meters}}&lt;br /&gt;
| &amp;lt;code&amp;gt;/whisper&amp;lt;/code&amp;gt; as the first few characters in a message can be used in viewer-2-code based viewers in local chat.&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Chat distance&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|20 meters}}&lt;br /&gt;
| text spoken as a &amp;quot;chat&amp;quot; step &#039;&#039;&#039;within gestures&#039;&#039;&#039; cannot be shouted or whispered. /whisper and /shout &#039;&#039;can&#039;&#039; be used in the &amp;quot;Replace with&amp;quot; field.&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Shout distance&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|100 meters}}&lt;br /&gt;
| &amp;lt;code&amp;gt;/shout&amp;lt;/code&amp;gt; as the first few characters in a message can be used in viewer-2-code based viewers in local chat.&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Length of a chat message and whether or not it is truncated&lt;br /&gt;
| {{no|1 byte or single-byte character}}&lt;br /&gt;
| {{no|1024 bytes or single-byte characters}}&lt;br /&gt;
| Limit does not apply to instant messages via [[llInstantMessage]] and communication between IM and email, the limit there is 1023 bytes or single-byte characters.&lt;br /&gt;
&lt;br /&gt;
The viewer-to-server communication on &#039;&#039;negative&#039;&#039; channels is truncated to 254 bytes, and on &#039;&#039;positive&#039;&#039; channels, to 1023 bytes. These limits do not affect scripts.&lt;br /&gt;
| [[llInstantMessage]]&lt;br /&gt;
|-&lt;br /&gt;
||Number of offline messages&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|Capped at 25 messages, unless the account has a Premium Subscription, in which case the cap raises to 50 messages.}}&lt;br /&gt;
| Number of offline messages (involving [[IM|IMs]], inventory offers, group notices, group invitations) received before messages get capped. Note: If autoAcceptNewInventory (debug setting) is set to TRUE (the default is FALSE), then all inventory offers, even above 25 (or 50 in the case of Premium members), go directly to inventory and do not count against the cap on offline messages. &lt;br /&gt;
| [[IM]] - [https://community.secondlife.com/t5/Featured-News/A-New-Perk-for-Premium-Subscribers/ba-p/2917357 Blog Post]&lt;br /&gt;
|-&lt;br /&gt;
||Length of a properly delivered email reply to an [[IM]]&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|1023 bytes or single-byte characters}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Time after which a reply to an [[IM]] can be sent via email.&lt;br /&gt;
| {{no|when receiving the IM via email.}}&lt;br /&gt;
| {{no|5 days after receiving the offline IM via email.}}&lt;br /&gt;
| n/a&lt;br /&gt;
| [https://blogs.secondlife.com/community/features/blog/2007/02/06/im-to-e-mail-return-addresses-changing Second Life Blogs]&lt;br /&gt;
|-&lt;br /&gt;
||Time period for which [[IM|IMs]] are stored within Second Life.&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|31 days after receiving the [[IM]]}}&lt;br /&gt;
| [[User:Torley_Linden|Torley Linden]] confirmed this with [[User:Kelly_Linden|Kelly Linden]]&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Number of [[IM|IMs]] sent by an object within an hour&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|5000 per hour}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== [[Gesture]]s ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||Shortcut key mappings&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|33 unique combinations, since {{K|F2}}&amp;amp;ndash;{{K|F12}} can be used with the {{K|Ctrl}} or {{K|Shift}} modifiers.}}&lt;br /&gt;
| n/a&lt;br /&gt;
| [[All_keyboard_shortcut_keys]] and [http://community.secondlife.com/t5/English-Knowledge-Base/Keyboard-shortcuts/ta-p/1086557 the knowledge base]&lt;br /&gt;
|-&lt;br /&gt;
||Chat step length&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|127 bytes or single-byte characters}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Wait time&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|3600 seconds (which is one hour)}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== [[Group]]s ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of groups you can belong to:&#039;&#039;&#039; 42&lt;br /&gt;
** Roles within groups are sort of like sub-groups. In many cases, you can use them instead of creating new groups.&lt;br /&gt;
* &#039;&#039;&#039;Minimum number of members in a group:&#039;&#039;&#039; 2&lt;br /&gt;
** A group with only 1 person for 48 hours will be disbanded (cancelled). Unless the group owns land.&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of roles allowed in a group:&#039;&#039;&#039; 10 (including &amp;quot;Owners&amp;quot; and &amp;quot;Everyone&amp;quot;, which cannot be deleted)&lt;br /&gt;
* &#039;&#039;&#039;Maximum Group Name:&#039;&#039;&#039; 35 single-byte characters.&lt;br /&gt;
* &#039;&#039;&#039;Maximum Group Title:&#039;&#039;&#039; 20 single-byte characters.&lt;br /&gt;
* &#039;&#039;&#039;Maximum Length of a Group Notice:&#039;&#039;&#039; 512 single-byte characters.&lt;br /&gt;
&lt;br /&gt;
== [[Inventory]] ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of inventory items that can be sent in a folder:&#039;&#039;&#039; 42&lt;br /&gt;
** Folders count as items too. This has more to do with packet size limits than cheeky Douglas Adams references.&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of inventory items that can be contained in a prim:&#039;&#039;&#039; None, but more items increase the loading time when you open it.&lt;br /&gt;
* &#039;&#039;&#039;Maximum characters in an inventory item name:&#039;&#039;&#039; 63&lt;br /&gt;
* &#039;&#039;&#039;Maximum notecard line:&#039;&#039;&#039; None, but scripts can only read the first 255 bytes.&lt;br /&gt;
* &#039;&#039;&#039;Maximum notecard size:&#039;&#039;&#039; 65,536 bytes&lt;br /&gt;
* &#039;&#039;&#039;Number of items in the Library:&#039;&#039;&#039; 1,248 as of 2010-06-17&lt;br /&gt;
* &#039;&#039;&#039;Number of items in the Library:&#039;&#039;&#039; 2,210 as of 2012-11-04&lt;br /&gt;
** Verified by [[How_does_the_Library_work|hiding the Library]] and counting the difference.&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of inventory items displayed in a single inventory folder:&#039;&#039;&#039; Several thousand. &amp;lt;!-- not a specific item count, because the data is variable size, but still useful to document that there is a limit. --&amp;gt;&lt;br /&gt;
** This was discussed during [http://wiki.secondlife.com/wiki/Simulator_User_Group/Transcripts/2011.03.08] &amp;quot;the folder will load up to the limit number of items, and remaining ones won&#039;t show up in the viewer. you still own them, they aren&#039;t lost, but they will be hidden until the folder size is reduced.&amp;quot;&lt;br /&gt;
** There is no specified limit for total avatar inventory, very large folders can be split.&lt;br /&gt;
** There was discussion in the Third Party Developers&#039; UG (4/10/2015) meeting about new inventory and login problems from having large numbers of items in a single folder. AISv3 &#039;&#039;removed&#039;&#039; server side limits on the number of items in a folder. Flat inventories are bad. No one is certain at what number of items in a folder cause a login problem. The fix is to clear the inventory cache (not the viewer cache) and log into a deserted, empty region then move inventory items into folders and sub-folders. - The problem appears at different a number of items depending on your computer and connection speed. Hopefully being on an empty region will give one enough edge to get logged in and do some corrective work before being dropped.&lt;br /&gt;
&lt;br /&gt;
== [[Land]] ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Maximum [[Land#Parcel|parcel]] size:&#039;&#039;&#039; 65,536 meters²&lt;br /&gt;
** Covering a whole region, or square on the World Map.&lt;br /&gt;
* &#039;&#039;&#039;Minimum parcel size:&#039;&#039;&#039; 16 meters²&lt;br /&gt;
* &#039;&#039;&#039;Maximum parcel name length:&#039;&#039;&#039; 63 single-byte characters&lt;br /&gt;
* &#039;&#039;&#039;Maximum parcel description length:&#039;&#039;&#039; 255 characters&lt;br /&gt;
* &#039;&#039;&#039;Region name length:&#039;&#039;&#039; Under Linden Concierge policy, minimum of 3 characters, and a maximum of 25 characters (including spaces). See [[Linden Lab Official:Guidelines for Private Region Naming|Guidelines for Private Region Naming]].&lt;br /&gt;
** Rare exceptions exist, like [http://slurl.com/secondlife/X/128/128/24 X].&lt;br /&gt;
* &#039;&#039;&#039;Maximum ban line height for &amp;quot;no entry&amp;quot; or &amp;quot;pay to access&amp;quot;&#039;&#039;&#039; (in other words, &amp;quot;allow public access&amp;quot; is turned off, or &amp;quot;allow group access&amp;quot; is turned on, in the parcel options) is the parcel&#039;s ground elevation &#039;&#039;plus&#039;&#039; 50 meters. If a user is &#039;&#039;&#039;explicitly banned by name&#039;&#039;&#039;, the height is the parcel&#039;s ground elevation &#039;&#039;plus&#039;&#039; 5000 meters. On current viewers this is visible to the full extent.&lt;br /&gt;
* &#039;&#039;&#039;Maximum prims in a [[Land#Region|region]]:&#039;&#039;&#039;&lt;br /&gt;
** Full region: 15,000&lt;br /&gt;
** [[Land#Homestead|Homestead]]: 3,750&lt;br /&gt;
** [[Land#Openspace|Openspace]]: 750&lt;br /&gt;
* &#039;&#039;&#039;Maximum auto return value&#039;&#039;&#039;: Besides &amp;quot;0&amp;quot; (which means &#039;&#039;never&#039;&#039;), {{HoverText|999,999|Almost 23 months}} minutes is the highest auto return value.&lt;br /&gt;
* &#039;&#039;&#039;Terraforming limits:&#039;&#039;&#039;&lt;br /&gt;
** Most mainland can be raised/lowered by 4 meters (+/-).&lt;br /&gt;
** Some mainland cannot be terraformed, including: Bay City regions, Boardman, Brown, De Haro, Kama City regions, Nautilus City regions, Nova Albion regions, and Shermerville regions.&lt;br /&gt;
** [http://community.secondlife.com/t5/English-Knowledge-Base/Linden-Homes/ta-p/700103 Linden Homes] do not allow terraforming.&lt;br /&gt;
** A few, very old mainland Regions like Da Boom have a terraform range of 40 meters (+/-).&lt;br /&gt;
** Estate (private island) terraformability is settable to a maximum of 100 meters (+/-) by the estate owner or managers.&lt;br /&gt;
* &#039;&#039;&#039;Maximum water height:&#039;&#039;&#039; 100 meters using inworld controls, 255 meters by using a *.raw file upload.&lt;br /&gt;
** Region water height is usually 20 meters, and adjacent regions should have the same water height, or else they will look discontinuous.&lt;br /&gt;
* &#039;&#039;&#039;Maximum terrain height:&#039;&#039;&#039; 255 meters using inworld controls (mainland limit), 510 meters by using a *.raw file upload.&lt;br /&gt;
* &#039;&#039;&#039;Miscellaneous estate limits:&#039;&#039;&#039; You can have a maximum of 10 estate managers, 500 allowed Residents, 63 allowed groups, and 500 banned Residents.&lt;br /&gt;
** See World menu &amp;gt; Region/Estate &amp;gt; Estate tab.&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of agents&#039;&#039;&#039;&lt;br /&gt;
** Full region: 100 (Typically set to 40 on mainland, 55 on Linden Homes regions, but this does vary. Some meeting areas have this set to 60 and higher.)&lt;br /&gt;
*** Recent server performance improvements make regions with 60 agents in them perform quite well.&lt;br /&gt;
** [[Land#Homestead|Homestead]]: 20&lt;br /&gt;
** [[Land#Openspace|Openspace]]: 10&lt;br /&gt;
* &#039;&#039;&#039;Freeze Time:&#039;&#039;&#039; Land owners can [[freeze]] other Residents for up to 30 seconds.  Members of land owning groups can also be granted this ability.&lt;br /&gt;
* &#039;&#039;&#039;Minimum parcel that can be listed in Places or All search:&#039;&#039;&#039; 144 meters² &amp;lt;!-- 128 and under are disabled --&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Minimum parcel that can be listed in Events:&#039;&#039;&#039; 512 meters²&lt;br /&gt;
* &#039;&#039;&#039;Maximum altitude for event listings:&#039;&#039;&#039;  768 meters ({{JIRA|WEB-814}})&lt;br /&gt;
* &#039;&#039;&#039;Maximum heights that objects can be seen on the [[World Map]]:&#039;&#039;&#039; 400.005m&lt;br /&gt;
&lt;br /&gt;
== [[Mesh]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||Number of vertices&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|65536 vertices per LOD for each [[mesh]] - See [[Talk:Limits#Mesh_Limits|discussion page]]}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||COLLADA file size&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|Maximum mesh asset size after compression is 8 MB, roughly equivalent to a 256 MB Raw COLLADA file.}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Bone influence weights per vertex&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|4}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Number of materials per mesh&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|8}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Number of materials per face&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|1}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Physics weight for a vehicle&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|32.0}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===User Found Temporary Mesh limits:===&lt;br /&gt;
&#039;&#039;Because of an apparent bug in the importer stay within these limits.&#039;&#039;&lt;br /&gt;
* 174,752 triangles, beyond which additional triangles will appear as holes.&lt;br /&gt;
* The 64k vertices per material is pre-empted by a limit of 21,844 triangles per material, which is presently reported as {{Jira|BUG-1001}}. (4/2014 - See [[Talk:Limits#Mesh_Limits|discussion page]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:: The import process will continue making new materials beyond 8 x 21,844 (=174,752) triangles, but the extra triangles then get dropped by the limitation to 8 materials, causing holes in the resulting object. Over the 21,844 triangle limit, the vertex count will start to climb steeply, even with smooth shading, because the materials get highly interspersed. So the same vertices have to appear in multiple material lists. So the moral of the story is to stay below 21,844 triangles per material, for now, if you want to avoid some unexpected effects.&lt;br /&gt;
&lt;br /&gt;
== Misc. ==&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;[https://secondlife.com/currency/describe-limits.php Billing and Trading Limits]&#039;&#039;&#039; - Includes [https://secondlife.com/whatis/economy-market.php LindeX] currency exchange limits.&lt;br /&gt;
*&#039;&#039;&#039;Contacts in Communication &amp;gt; Friends tab &#039;&#039;&#039; - A maximum of 20 simultaneous contacts can be selected to change permissions, remove, or invite for a conference chat.&lt;br /&gt;
&lt;br /&gt;
== Navigation ==&lt;br /&gt;
&lt;br /&gt;
[[File:Max Alt.jpg|thumb|right|435px|&#039;&#039;&#039;Height counter error above 2147483647 meters&#039;&#039;&#039;]]&lt;br /&gt;
* &#039;&#039;&#039;Absolute height limit:&#039;&#039;&#039; [http://en.wikipedia.org/wiki/2147483647#2147483647_in_computing 2147483647]&amp;amp;nbsp;=&amp;amp;nbsp;2&amp;lt;sup&amp;gt;31&amp;lt;/sup&amp;gt;&amp;amp;nbsp;−&amp;amp;nbsp;1 meters, which causes the altitude counter to roll over. Altitudes well below this cause graphics errors probably due to limited floating point number precision.&lt;br /&gt;
* &#039;&#039;&#039;Highest z-value of an [[SLurl]], that will still teleport you to a positive altitude:&#039;&#039;&#039; 4096&lt;br /&gt;
** This used to be much higher, but is clamped in late model viewers.&lt;br /&gt;
&lt;br /&gt;
== [[Profile]] ==&lt;br /&gt;
&lt;br /&gt;
Each 7-bit ASCII character is encoded in one byte. International characters might need more bytes. When pasting text instead of typing, you can get in one byte more into each of the below.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;2nd Life tab&#039;s About field&#039;&#039;&#039; - 510 bytes&lt;br /&gt;
* &#039;&#039;&#039;Picks tab&#039;&#039;&#039; - 10 picks with 1022 bytes each&lt;br /&gt;
* &#039;&#039;&#039;1st Life tab&#039;s Info field&#039;&#039;&#039; - 253 bytes&lt;br /&gt;
* &#039;&#039;&#039;Classified tab&#039;&#039;&#039; - 100 listings with x bytes each&lt;br /&gt;
* &#039;&#039;&#039;My Notes&#039;&#039;&#039; - 1022 bytes&lt;br /&gt;
&lt;br /&gt;
== Performance ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Healthy Viewer FPS&#039;&#039;&#039; - Generally, FPS above 15 is good. The higher it gets, the smoother. You can check via [[Advanced]] menu &amp;gt; Performance Tools &amp;gt; Lag Meter, or for more advanced usage, see Advanced &amp;gt; Performance Tools &amp;gt; Statistics Bar.&lt;br /&gt;
* &#039;&#039;&#039;Avatar Rendering Cost scores&#039;&#039;&#039; - [[Avatar Rendering Cost|Learn all about it!]]&lt;br /&gt;
&lt;br /&gt;
== [[Scripting]] == &amp;lt;!-- Important scripting limits should be placed here, less important ones should be in the articles Caveats or Specification sections --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Height at which scripts reactivate on a no-script parcel&#039;&#039;&#039; - 50 m above terrain mesh. Scripted objects that take controls will keep running when you fly down or enter a no-script parcel. (If scripts are disabled in the region debug panel, they will not run at any height.)&lt;br /&gt;
* &#039;&#039;&#039;Maximum height where scripts can run&#039;&#039;&#039; - none, as long as the object remains rezzed or attached.&lt;br /&gt;
* &#039;&#039;&#039;Maximum script source code size&#039;&#039;&#039; - 65536 single byte characters (that&#039;s a viewer limit and can be changed in the config file &#039;panel_script_ed.xml&#039;).&lt;br /&gt;
* &#039;&#039;&#039;Maximum script memory size (LSO)&#039;&#039;&#039; - 16384 bytes.&lt;br /&gt;
* &#039;&#039;&#039;Maximum script memory size (Mono)&#039;&#039;&#039; - 65536 bytes (the maximum memory available to Mono scripts can be constrained via [[llSetMemoryLimit]]).&lt;br /&gt;
* &#039;&#039;&#039;Maximum active [[llListen|listeners]] per script&#039;&#039;&#039; - 65.&lt;br /&gt;
** &#039;&#039;&#039;Usable channel for each listener&#039;&#039;&#039; - &#039;&#039;min.&#039;&#039; -2147483648, &#039;&#039;max.&#039;&#039; 2147483647, including the following special channels: [[PUBLIC_CHANNEL]] &#039;&#039;and&#039;&#039; [[DEBUG_CHANNEL]].&lt;br /&gt;
* For specific scripting limits, look up calls in the &#039;&#039;&#039;[[LSL Portal]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== [[Sound]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||Sound length&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|any length &#039;&#039;less than&#039;&#039; 10.0 seconds}}&lt;br /&gt;
| You&#039;re advised to cut longer sounds into 9.9-second-pieces.&lt;br /&gt;
| n/a&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== [[Textures]] ==&lt;br /&gt;
* &#039;&#039;&#039;[http://en.wikipedia.org/wiki/Aspect_ratio Aspect ratios]&#039;&#039;&#039; of profile, place, etc. pictures — all of these were measured at UI size (Edit menu &amp;gt; Preferences &amp;gt; General tab &amp;gt; UI Size) = 1.000:&lt;br /&gt;
&lt;br /&gt;
=== Second Life Viewer 3.6 ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Classifieds thumbnail&#039;&#039;&#039; - ~3:2 (101&amp;amp;times;69 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Classifieds expanded&#039;&#039;&#039; - ~4:3 (159&amp;amp;times;120 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Classifieds expanded &amp;gt; More Info&#039;&#039;&#039; - native aspect ratio&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Destination Guide thumbnail&#039;&#039;&#039; - ~3:2 (101&amp;amp;times;69 pixels) &lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Destination Guide expanded&#039;&#039;&#039; - ~4:3 (159&amp;amp;times;120 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; People&#039;&#039;&#039; - 1:1 (100&amp;amp;times;100 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Places expanded&#039;&#039;&#039; ~4:3 (159&amp;amp;times;120 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Place Profile&#039;&#039;&#039; - ~3:2 (290&amp;amp;times;197 pixels)&lt;br /&gt;
* &#039;&#039;&#039;About Land &amp;gt; Options tab&#039;&#039;&#039; - ~4:3 (195&amp;amp;times;150 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Picture&#039;&#039;&#039; - native aspect ratio; thumbnail cropped to 72&amp;amp;times;72 pixels; zoomed uncropped up to 300&amp;amp;times;300 pixels&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Real world picture&#039;&#039;&#039; - native aspect ratio; thumbnail cropped to 45&amp;amp;times;45 pixels; zoomed uncropped up to 300&amp;amp;times;300 pixels&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Picks thumbnail&#039;&#039;&#039; - 4:3 (60&amp;amp;times;45 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Pick expanded&#039;&#039;&#039; - 4:3 (320&amp;amp;times;240 pixels)&lt;br /&gt;
&lt;br /&gt;
=== 1.x Series Viewers ===&lt;br /&gt;
(official Viewer up to 1.23.5, still used by some [[Alternate viewers|Third Party Viewers]])&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; All for &amp;quot;Classifieds&amp;quot;, &amp;quot;People&amp;quot;, and &amp;quot;Places&amp;quot;&#039;&#039;&#039; - 4:3 (256&amp;amp;times;192 pi&amp;amp;times;els)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Places and Classified tabs&#039;&#039;&#039; - ~7:5 (398&amp;amp;times;282 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Land tab&#039;&#039;&#039; - ~7:5 (358&amp;amp;times;252 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; 2nd Life tab&#039;&#039;&#039; - ~4:3 (178&amp;amp;times;133 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Picks tab&#039;&#039;&#039; - 16:9 (288&amp;amp;times;162 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; 1st Life tab&#039;&#039;&#039; - 1:1 (133&amp;amp;times;133 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Classifieds tab&#039;&#039;&#039; - ~3:2 (206&amp;amp;times;137 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Web tab&#039;&#039;&#039; - 1:1 (400&amp;amp;times;400 pixels)&lt;br /&gt;
** A scrollbar uses 15 pixels on the right-hand side.&lt;br /&gt;
* &#039;&#039;&#039;About Land &amp;gt; Options tab&#039;&#039;&#039; - ~3:2 (178&amp;amp;times;117 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Group Information &amp;gt; General tab&#039;s &amp;quot;Group Insignia&amp;quot;&#039;&#039;&#039; - 1:1 (126&amp;amp;times;126 pixels)&lt;br /&gt;
** Some of these textures are shared (for example, Search &amp;gt; All place pages, Search &amp;gt; Places, and About Land &amp;gt; Options use the same image), so you should pick a well-balanced ratio and size.&lt;br /&gt;
** [[Texture_aspect_ratios|Learn how to get correct texture aspect ratios when editing images.]]&lt;br /&gt;
&lt;br /&gt;
=== All Viewers ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Maximum texture size&#039;&#039;&#039; - 1024&amp;amp;times;1024 pixels&lt;br /&gt;
** All Second Life textures are constrained to [http://en.wikipedia.org/wiki/Power_of_2 powers of 2] (e.g., 128, 256, 512).&lt;br /&gt;
** Some textures inworld have a resolution as high as 2048&amp;amp;times;2048; this is due to a previous limit that was higher.&lt;br /&gt;
** We strongly recommend you use as small textures as possible because larger ones consume more memory and take substantially longer to load.&lt;br /&gt;
** Where large textures are being forced by import to only 512&amp;amp;times;512, lower your ...&amp;gt; Preferences &amp;gt;...&amp;gt; UI Size under 1.0, to increase import size to the max 1024&amp;amp;times;1024.&lt;br /&gt;
&lt;br /&gt;
[[Category:Creation]] [[Category:Tutorials]] [[Category:Lists]]&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
In general 1 byte is enough to contain one character.&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Limits&amp;diff=1196448</id>
		<title>Limits</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Limits&amp;diff=1196448"/>
		<updated>2015-05-09T19:28:02Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: /* Communication */ Add also a note on positive channels.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{KBmaster}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
== Summary ==&lt;br /&gt;
{{RightToc}}&lt;br /&gt;
The Second Life Viewer and simulators have a division of labor, keeping track of the data that makes Second Life run. The Viewer&#039;s job is to:&lt;br /&gt;
&lt;br /&gt;
* Handle locations of objects.&lt;br /&gt;
* Get velocities and other physics information, and does simple physics to keep track of what is moving where.&lt;br /&gt;
&lt;br /&gt;
The simulator&#039;s job is to:&lt;br /&gt;
&lt;br /&gt;
* Run the physics engine.&lt;br /&gt;
* Detect collisions.&lt;br /&gt;
* Keep track of where everything is&lt;br /&gt;
* Send locations of content to the Viewer along with updates when certain changes occur.&lt;br /&gt;
&lt;br /&gt;
Limits are necessary for all of these components to work together. The list below outlines many of the &#039;&#039;&#039;Second Life numerical limits that affect your inworld experience&#039;&#039;&#039;. Some of these will likely change over time, so if you spot something incorrect/outdated, please take a moment to update it.&lt;br /&gt;
&lt;br /&gt;
{{KBcaution|1=The scope of this page is focused on Linden Lab&#039;s official Viewers, keeping in mind [[Third_Party_Viewer_Directory|3rd-party viewers may differ]]. Cite sources and provide substantiation for limits that aren&#039;t provided by Linden Lab. Also, unconfirmed speculation [[Talk:Limits|goes on this discussion page]]. Don&#039;t add data without a hard limit, and don&#039;t add obscure trivia that doesn&#039;t practically affect the general inworld experience.|width=80%}}&lt;br /&gt;
&lt;br /&gt;
== [[Avatar]] ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Max. # of attachments&#039;&#039;&#039; - 38 combined [[HUD]] or body attachments.&lt;br /&gt;
** They can be viewed by right-clicking your avatar and choosing &#039;&#039;&#039;Edit My Outfit&#039;&#039;&#039;.&lt;br /&gt;
** With the formal introduction of [[multiple attachments|multiple attachments to a single point]] in Viewer 2.4, you can attach up to 38 total objects, and they can all be attached to a single point. &lt;br /&gt;
* &#039;&#039;&#039;Max. # of clothing layers&#039;&#039;&#039; including alpha, tattoo, shoe base, physics, socks, gloves, undershirt, underpants, shirt, pants, jacket, skirt&lt;br /&gt;
** On viewers from before the layer limits project: 5 per slot&lt;br /&gt;
** On viewers with revised layer limits: up to 60 total, no per-slot limit. &#039;&#039;As of May 2015, this is only available in candidate viewers.&#039;&#039;&lt;br /&gt;
** In any case, only one each of shape, skin, eyes and hair base may be worn.&lt;br /&gt;
* &#039;&#039;&#039;Max Clothing Texture&#039;&#039;&#039; - 512x512 px (except 128x128 px for eyes) - Server Side Appearance (and legacy baking on outside grids) will downsize larger textures.&amp;lt;!--per Nyx Linden 9/23/2013 Content n Mesh Meeting--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Max. unassisted fly height&#039;&#039;&#039; - Stable hover at current ground elevation &#039;&#039;plus&#039;&#039; 5020m.&lt;br /&gt;
** You can easily acquire a flight attachment to fly high. Also see [[flight limit]] and [[Limits#Navigation|the Navigation section]] below.&lt;br /&gt;
* &#039;&#039;&#039;Common shoe sizes&#039;&#039;&#039; - Traditionally, most women&#039;s shoes were designed for a size 0 (zero) foot. Men&#039;s generally scale up to 14. Newer items (mesh and some sculpted) replace the system feet or conform to the avatar&#039;s shape, so adjustments may be necessary.&lt;br /&gt;
** You can check this by going to Edit menu &amp;gt; Appearance and clicking on the Shape &amp;gt; Legs tab.&lt;br /&gt;
&amp;lt;!--Can someone verify the following?&lt;br /&gt;
* &#039;&#039;&#039;Min. length of avatar name&#039;&#039;&#039; - 2 for first name, 2 for last name, 5 in total (including the space).--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Max. length of avatar name&#039;&#039;&#039; - 31 for first name, 31 for last name, 63 in total (including the space).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Max. length of {{LSLGC|Username}}&#039;&#039;&#039; - All lower case and a maximum of 63 including the &#039;.&#039;(eg; firstname.lastname)&lt;br /&gt;
**Older account user names are a combination of the First and last name in lower case separated by a period(.)(eg; lilmix.pixelmaid)&lt;br /&gt;
**Modern user names are a single name(no period)(eg; john1234) - &#039;&#039;&#039;Max.&#039;&#039;&#039; length is 31 characters&lt;br /&gt;
**The {{LSLGC|Legacy Name}}s for modern user names always shows Resident as the last name. So the Max is 40 characters in total for a new avatar&#039;s legacy name(including the space and last name &#039;Resident&#039;)&lt;br /&gt;
*&#039;&#039;&#039;Min. length of [[Display_Names]]&#039;&#039;&#039; - At least one script character&lt;br /&gt;
*&#039;&#039;&#039;Max. length of Display Names&#039;&#039;&#039; - 31 characters&lt;br /&gt;
**Display Names can include most Unicode script characters, spaces, and some punctuation.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Max. avatar speed&#039;&#039;&#039; - 250m/s (with only attachments to assist)&lt;br /&gt;
* &#039;&#039;&#039;Max. teleport speed&#039;&#039;&#039;&amp;lt;!-- - 3 teleports per 15 seconds (server 1.27.0) and 10 teleports per 15 seconds (server 1.27.1)--&amp;gt; - 10 teleports per 15 seconds, since SL server 1.27.1&lt;br /&gt;
&lt;br /&gt;
== [[Animation]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||Length of animation&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|60.0 seconds}}&lt;br /&gt;
| Limited by length or Size, whichever is reached first&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Size of Animation&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|120k bytes}}&lt;br /&gt;
| Limited by length or Size, whichever is reached first. Size is after conversion to SL [[Internal Animation Format|internal animaton format]], not BVH source which can be much larger.&lt;br /&gt;
| n/a&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||animation priority&lt;br /&gt;
| {{no|0}}&lt;br /&gt;
| {{no|4, with custom tools 6}}&lt;br /&gt;
| n/a&lt;br /&gt;
| [[Animation_Priority]]&lt;br /&gt;
|-&lt;br /&gt;
||Number of unique joints per animation&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|32}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== [http://community.secondlife.com/t5/English-Knowledge-Base/Build-Tools/ta-p/700039 Building] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||[[Prim]] dimensions&lt;br /&gt;
| {{no|&amp;lt;0.01,&amp;amp;nbsp;0.01,&amp;amp;nbsp;0.01&amp;gt;}}&lt;br /&gt;
| {{no|&amp;lt;64.0, 64.0, 64.0&amp;gt;}}&lt;br /&gt;
| Used to be &amp;lt;10.0, 10.0, 10.0&amp;gt; prior to Second Life Server version 11.08.17.238770&lt;br /&gt;
| [[llSetScale]], [[PRIM_SIZE]] and [[Megaprim]]&lt;br /&gt;
|-&lt;br /&gt;
||Number of prims in a linkset&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|256 prims}}&lt;br /&gt;
| Used to be 255 prior to Second Life Server version 1.26&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Linking distance&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|[[Linkability_Rules]]}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||[[Mesh/Mesh_physics#Physics_Resource_Cost|Physics cost]] for a physical object&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|32.0}}&lt;br /&gt;
||Additional notes:&lt;br /&gt;
* If you try to link more, it&#039;ll either say &amp;quot;Can&#039;t enable physics for objects with more than 32 primitives&amp;quot; or &amp;quot;Object has too many primitives -- its dynamics have been disabled.&amp;quot;.&lt;br /&gt;
* On server versions 1.38 and below, each sitting avatar counted as 1 prim. From 1.40.2 the limit is only on actual prims.&lt;br /&gt;
| [[OBJECT_PHYSICS_COST]]&lt;br /&gt;
|-&lt;br /&gt;
||Build or rez height&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|4096.0 meters}}&lt;br /&gt;
| 768.0 meters for Viewers prior to version 1.20&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Prim name length&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|63 bytes UTF-8 [[String|string]]}}&lt;br /&gt;
| same limit for {{LSLGC|Avatar/Name|avatar names}}, although the character set for avatar names is significantly limited.&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Prim description length&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|127 bytes UTF-8 [[String|string]]}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Temporary prims&#039; lifetime&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|up to around 60 seconds}}&lt;br /&gt;
| depends upon when the next garbage collector cycle is&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Number of temporary prims&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|RegionPrimLimit - NumberOfPrimsInRegion + Minimum(0.5*RegionPrimLimit, 1000)}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Length of hovertext&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|254 bytes UTF-8 [[String|string]]}}&lt;br /&gt;
| n/a&lt;br /&gt;
| [[llSetText]] and [[PRIM_TEXT]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== [[Communication]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||Whisper distance&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|10 meters}}&lt;br /&gt;
| &amp;lt;code&amp;gt;/whisper&amp;lt;/code&amp;gt; as the first few characters in a message can be used in viewer-2-code based viewers in local chat.&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Chat distance&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|20 meters}}&lt;br /&gt;
| text spoken as a &amp;quot;chat&amp;quot; step &#039;&#039;&#039;within gestures&#039;&#039;&#039; cannot be shouted or whispered. /whisper and /shout &#039;&#039;can&#039;&#039; be used in the &amp;quot;Replace with&amp;quot; field.&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Shout distance&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|100 meters}}&lt;br /&gt;
| &amp;lt;code&amp;gt;/shout&amp;lt;/code&amp;gt; as the first few characters in a message can be used in viewer-2-code based viewers in local chat.&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Length of a chat message and whether or not it is truncated&lt;br /&gt;
| {{no|1 byte or single-byte character}}&lt;br /&gt;
| {{no|1024 bytes or single-byte characters}}&lt;br /&gt;
| Limit does not apply to instant messages via [[llInstantMessage]] and communication between IM and email, the limit there is 1023 bytes or single-byte characters.&lt;br /&gt;
&lt;br /&gt;
The viewer-to-server communication on &#039;&#039;negative&#039;&#039; channels is truncated to 254 bytes, and on &#039;&#039;positive channels, to 1023 bytes. These limits do not affect scripts.&lt;br /&gt;
| [[llInstantMessage]]&lt;br /&gt;
|-&lt;br /&gt;
||Number of offline messages&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|Capped at 25 messages, unless the account has a Premium Subscription, in which case the cap raises to 50 messages.}}&lt;br /&gt;
| Number of offline messages (involving [[IM|IMs]], inventory offers, group notices, group invitations) received before messages get capped. Note: If autoAcceptNewInventory (debug setting) is set to TRUE (the default is FALSE), then all inventory offers, even above 25 (or 50 in the case of Premium members), go directly to inventory and do not count against the cap on offline messages. &lt;br /&gt;
| [[IM]] - [https://community.secondlife.com/t5/Featured-News/A-New-Perk-for-Premium-Subscribers/ba-p/2917357 Blog Post]&lt;br /&gt;
|-&lt;br /&gt;
||Length of a properly delivered email reply to an [[IM]]&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|1023 bytes or single-byte characters}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Time after which a reply to an [[IM]] can be sent via email.&lt;br /&gt;
| {{no|when receiving the IM via email.}}&lt;br /&gt;
| {{no|5 days after receiving the offline IM via email.}}&lt;br /&gt;
| n/a&lt;br /&gt;
| [https://blogs.secondlife.com/community/features/blog/2007/02/06/im-to-e-mail-return-addresses-changing Second Life Blogs]&lt;br /&gt;
|-&lt;br /&gt;
||Time period for which [[IM|IMs]] are stored within Second Life.&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|31 days after receiving the [[IM]]}}&lt;br /&gt;
| [[User:Torley_Linden|Torley Linden]] confirmed this with [[User:Kelly_Linden|Kelly Linden]]&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Number of [[IM|IMs]] sent by an object within an hour&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|5000 per hour}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== [[Gesture]]s ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||Shortcut key mappings&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|33 unique combinations, since {{K|F2}}&amp;amp;ndash;{{K|F12}} can be used with the {{K|Ctrl}} or {{K|Shift}} modifiers.}}&lt;br /&gt;
| n/a&lt;br /&gt;
| [[All_keyboard_shortcut_keys]] and [http://community.secondlife.com/t5/English-Knowledge-Base/Keyboard-shortcuts/ta-p/1086557 the knowledge base]&lt;br /&gt;
|-&lt;br /&gt;
||Chat step length&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|127 bytes or single-byte characters}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Wait time&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|3600 seconds (which is one hour)}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== [[Group]]s ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of groups you can belong to:&#039;&#039;&#039; 42&lt;br /&gt;
** Roles within groups are sort of like sub-groups. In many cases, you can use them instead of creating new groups.&lt;br /&gt;
* &#039;&#039;&#039;Minimum number of members in a group:&#039;&#039;&#039; 2&lt;br /&gt;
** A group with only 1 person for 48 hours will be disbanded (cancelled). Unless the group owns land.&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of roles allowed in a group:&#039;&#039;&#039; 10 (including &amp;quot;Owners&amp;quot; and &amp;quot;Everyone&amp;quot;, which cannot be deleted)&lt;br /&gt;
* &#039;&#039;&#039;Maximum Group Name:&#039;&#039;&#039; 35 single-byte characters.&lt;br /&gt;
* &#039;&#039;&#039;Maximum Group Title:&#039;&#039;&#039; 20 single-byte characters.&lt;br /&gt;
* &#039;&#039;&#039;Maximum Length of a Group Notice:&#039;&#039;&#039; 512 single-byte characters.&lt;br /&gt;
&lt;br /&gt;
== [[Inventory]] ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of inventory items that can be sent in a folder:&#039;&#039;&#039; 42&lt;br /&gt;
** Folders count as items too. This has more to do with packet size limits than cheeky Douglas Adams references.&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of inventory items that can be contained in a prim:&#039;&#039;&#039; None, but more items increase the loading time when you open it.&lt;br /&gt;
* &#039;&#039;&#039;Maximum characters in an inventory item name:&#039;&#039;&#039; 63&lt;br /&gt;
* &#039;&#039;&#039;Maximum notecard line:&#039;&#039;&#039; None, but scripts can only read the first 255 bytes.&lt;br /&gt;
* &#039;&#039;&#039;Maximum notecard size:&#039;&#039;&#039; 65,536 bytes&lt;br /&gt;
* &#039;&#039;&#039;Number of items in the Library:&#039;&#039;&#039; 1,248 as of 2010-06-17&lt;br /&gt;
* &#039;&#039;&#039;Number of items in the Library:&#039;&#039;&#039; 2,210 as of 2012-11-04&lt;br /&gt;
** Verified by [[How_does_the_Library_work|hiding the Library]] and counting the difference.&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of inventory items displayed in a single inventory folder:&#039;&#039;&#039; Several thousand. &amp;lt;!-- not a specific item count, because the data is variable size, but still useful to document that there is a limit. --&amp;gt;&lt;br /&gt;
** This was discussed during [http://wiki.secondlife.com/wiki/Simulator_User_Group/Transcripts/2011.03.08] &amp;quot;the folder will load up to the limit number of items, and remaining ones won&#039;t show up in the viewer. you still own them, they aren&#039;t lost, but they will be hidden until the folder size is reduced.&amp;quot;&lt;br /&gt;
** There is no specified limit for total avatar inventory, very large folders can be split.&lt;br /&gt;
** There was discussion in the Third Party Developers&#039; UG (4/10/2015) meeting about new inventory and login problems from having large numbers of items in a single folder. AISv3 &#039;&#039;removed&#039;&#039; server side limits on the number of items in a folder. Flat inventories are bad. No one is certain at what number of items in a folder cause a login problem. The fix is to clear the inventory cache (not the viewer cache) and log into a deserted, empty region then move inventory items into folders and sub-folders. - The problem appears at different a number of items depending on your computer and connection speed. Hopefully being on an empty region will give one enough edge to get logged in and do some corrective work before being dropped.&lt;br /&gt;
&lt;br /&gt;
== [[Land]] ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Maximum [[Land#Parcel|parcel]] size:&#039;&#039;&#039; 65,536 meters²&lt;br /&gt;
** Covering a whole region, or square on the World Map.&lt;br /&gt;
* &#039;&#039;&#039;Minimum parcel size:&#039;&#039;&#039; 16 meters²&lt;br /&gt;
* &#039;&#039;&#039;Maximum parcel name length:&#039;&#039;&#039; 63 single-byte characters&lt;br /&gt;
* &#039;&#039;&#039;Maximum parcel description length:&#039;&#039;&#039; 255 characters&lt;br /&gt;
* &#039;&#039;&#039;Region name length:&#039;&#039;&#039; Under Linden Concierge policy, minimum of 3 characters, and a maximum of 25 characters (including spaces). See [[Linden Lab Official:Guidelines for Private Region Naming|Guidelines for Private Region Naming]].&lt;br /&gt;
** Rare exceptions exist, like [http://slurl.com/secondlife/X/128/128/24 X].&lt;br /&gt;
* &#039;&#039;&#039;Maximum ban line height for &amp;quot;no entry&amp;quot; or &amp;quot;pay to access&amp;quot;&#039;&#039;&#039; (in other words, &amp;quot;allow public access&amp;quot; is turned off, or &amp;quot;allow group access&amp;quot; is turned on, in the parcel options) is the parcel&#039;s ground elevation &#039;&#039;plus&#039;&#039; 50 meters. If a user is &#039;&#039;&#039;explicitly banned by name&#039;&#039;&#039;, the height is the parcel&#039;s ground elevation &#039;&#039;plus&#039;&#039; 5000 meters. On current viewers this is visible to the full extent.&lt;br /&gt;
* &#039;&#039;&#039;Maximum prims in a [[Land#Region|region]]:&#039;&#039;&#039;&lt;br /&gt;
** Full region: 15,000&lt;br /&gt;
** [[Land#Homestead|Homestead]]: 3,750&lt;br /&gt;
** [[Land#Openspace|Openspace]]: 750&lt;br /&gt;
* &#039;&#039;&#039;Maximum auto return value&#039;&#039;&#039;: Besides &amp;quot;0&amp;quot; (which means &#039;&#039;never&#039;&#039;), {{HoverText|999,999|Almost 23 months}} minutes is the highest auto return value.&lt;br /&gt;
* &#039;&#039;&#039;Terraforming limits:&#039;&#039;&#039;&lt;br /&gt;
** Most mainland can be raised/lowered by 4 meters (+/-).&lt;br /&gt;
** Some mainland cannot be terraformed, including: Bay City regions, Boardman, Brown, De Haro, Kama City regions, Nautilus City regions, Nova Albion regions, and Shermerville regions.&lt;br /&gt;
** [http://community.secondlife.com/t5/English-Knowledge-Base/Linden-Homes/ta-p/700103 Linden Homes] do not allow terraforming.&lt;br /&gt;
** A few, very old mainland Regions like Da Boom have a terraform range of 40 meters (+/-).&lt;br /&gt;
** Estate (private island) terraformability is settable to a maximum of 100 meters (+/-) by the estate owner or managers.&lt;br /&gt;
* &#039;&#039;&#039;Maximum water height:&#039;&#039;&#039; 100 meters using inworld controls, 255 meters by using a *.raw file upload.&lt;br /&gt;
** Region water height is usually 20 meters, and adjacent regions should have the same water height, or else they will look discontinuous.&lt;br /&gt;
* &#039;&#039;&#039;Maximum terrain height:&#039;&#039;&#039; 255 meters using inworld controls (mainland limit), 510 meters by using a *.raw file upload.&lt;br /&gt;
* &#039;&#039;&#039;Miscellaneous estate limits:&#039;&#039;&#039; You can have a maximum of 10 estate managers, 500 allowed Residents, 63 allowed groups, and 500 banned Residents.&lt;br /&gt;
** See World menu &amp;gt; Region/Estate &amp;gt; Estate tab.&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of agents&#039;&#039;&#039;&lt;br /&gt;
** Full region: 100 (Typically set to 40 on mainland, 55 on Linden Homes regions, but this does vary. Some meeting areas have this set to 60 and higher.)&lt;br /&gt;
*** Recent server performance improvements make regions with 60 agents in them perform quite well.&lt;br /&gt;
** [[Land#Homestead|Homestead]]: 20&lt;br /&gt;
** [[Land#Openspace|Openspace]]: 10&lt;br /&gt;
* &#039;&#039;&#039;Freeze Time:&#039;&#039;&#039; Land owners can [[freeze]] other Residents for up to 30 seconds.  Members of land owning groups can also be granted this ability.&lt;br /&gt;
* &#039;&#039;&#039;Minimum parcel that can be listed in Places or All search:&#039;&#039;&#039; 144 meters² &amp;lt;!-- 128 and under are disabled --&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Minimum parcel that can be listed in Events:&#039;&#039;&#039; 512 meters²&lt;br /&gt;
* &#039;&#039;&#039;Maximum altitude for event listings:&#039;&#039;&#039;  768 meters ({{JIRA|WEB-814}})&lt;br /&gt;
* &#039;&#039;&#039;Maximum heights that objects can be seen on the [[World Map]]:&#039;&#039;&#039; 400.005m&lt;br /&gt;
&lt;br /&gt;
== [[Mesh]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||Number of vertices&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|65536 vertices per LOD for each [[mesh]] - See [[Talk:Limits#Mesh_Limits|discussion page]]}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||COLLADA file size&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|Maximum mesh asset size after compression is 8 MB, roughly equivalent to a 256 MB Raw COLLADA file.}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Bone influence weights per vertex&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|4}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Number of materials per mesh&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|8}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Number of materials per face&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|1}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Physics weight for a vehicle&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|32.0}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===User Found Temporary Mesh limits:===&lt;br /&gt;
&#039;&#039;Because of an apparent bug in the importer stay within these limits.&#039;&#039;&lt;br /&gt;
* 174,752 triangles, beyond which additional triangles will appear as holes.&lt;br /&gt;
* The 64k vertices per material is pre-empted by a limit of 21,844 triangles per material, which is presently reported as {{Jira|BUG-1001}}. (4/2014 - See [[Talk:Limits#Mesh_Limits|discussion page]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:: The import process will continue making new materials beyond 8 x 21,844 (=174,752) triangles, but the extra triangles then get dropped by the limitation to 8 materials, causing holes in the resulting object. Over the 21,844 triangle limit, the vertex count will start to climb steeply, even with smooth shading, because the materials get highly interspersed. So the same vertices have to appear in multiple material lists. So the moral of the story is to stay below 21,844 triangles per material, for now, if you want to avoid some unexpected effects.&lt;br /&gt;
&lt;br /&gt;
== Misc. ==&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;[https://secondlife.com/currency/describe-limits.php Billing and Trading Limits]&#039;&#039;&#039; - Includes [https://secondlife.com/whatis/economy-market.php LindeX] currency exchange limits.&lt;br /&gt;
*&#039;&#039;&#039;Contacts in Communication &amp;gt; Friends tab &#039;&#039;&#039; - A maximum of 20 simultaneous contacts can be selected to change permissions, remove, or invite for a conference chat.&lt;br /&gt;
&lt;br /&gt;
== Navigation ==&lt;br /&gt;
&lt;br /&gt;
[[File:Max Alt.jpg|thumb|right|435px|&#039;&#039;&#039;Height counter error above 2147483647 meters&#039;&#039;&#039;]]&lt;br /&gt;
* &#039;&#039;&#039;Absolute height limit:&#039;&#039;&#039; [http://en.wikipedia.org/wiki/2147483647#2147483647_in_computing 2147483647]&amp;amp;nbsp;=&amp;amp;nbsp;2&amp;lt;sup&amp;gt;31&amp;lt;/sup&amp;gt;&amp;amp;nbsp;−&amp;amp;nbsp;1 meters, which causes the altitude counter to roll over. Altitudes well below this cause graphics errors probably due to limited floating point number precision.&lt;br /&gt;
* &#039;&#039;&#039;Highest z-value of an [[SLurl]], that will still teleport you to a positive altitude:&#039;&#039;&#039; 4096&lt;br /&gt;
** This used to be much higher, but is clamped in late model viewers.&lt;br /&gt;
&lt;br /&gt;
== [[Profile]] ==&lt;br /&gt;
&lt;br /&gt;
Each 7-bit ASCII character is encoded in one byte. International characters might need more bytes. When pasting text instead of typing, you can get in one byte more into each of the below.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;2nd Life tab&#039;s About field&#039;&#039;&#039; - 510 bytes&lt;br /&gt;
* &#039;&#039;&#039;Picks tab&#039;&#039;&#039; - 10 picks with 1022 bytes each&lt;br /&gt;
* &#039;&#039;&#039;1st Life tab&#039;s Info field&#039;&#039;&#039; - 253 bytes&lt;br /&gt;
* &#039;&#039;&#039;Classified tab&#039;&#039;&#039; - 100 listings with x bytes each&lt;br /&gt;
* &#039;&#039;&#039;My Notes&#039;&#039;&#039; - 1022 bytes&lt;br /&gt;
&lt;br /&gt;
== Performance ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Healthy Viewer FPS&#039;&#039;&#039; - Generally, FPS above 15 is good. The higher it gets, the smoother. You can check via [[Advanced]] menu &amp;gt; Performance Tools &amp;gt; Lag Meter, or for more advanced usage, see Advanced &amp;gt; Performance Tools &amp;gt; Statistics Bar.&lt;br /&gt;
* &#039;&#039;&#039;Avatar Rendering Cost scores&#039;&#039;&#039; - [[Avatar Rendering Cost|Learn all about it!]]&lt;br /&gt;
&lt;br /&gt;
== [[Scripting]] == &amp;lt;!-- Important scripting limits should be placed here, less important ones should be in the articles Caveats or Specification sections --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Height at which scripts reactivate on a no-script parcel&#039;&#039;&#039; - 50 m above terrain mesh. Scripted objects that take controls will keep running when you fly down or enter a no-script parcel. (If scripts are disabled in the region debug panel, they will not run at any height.)&lt;br /&gt;
* &#039;&#039;&#039;Maximum height where scripts can run&#039;&#039;&#039; - none, as long as the object remains rezzed or attached.&lt;br /&gt;
* &#039;&#039;&#039;Maximum script source code size&#039;&#039;&#039; - 65536 single byte characters (that&#039;s a viewer limit and can be changed in the config file &#039;panel_script_ed.xml&#039;).&lt;br /&gt;
* &#039;&#039;&#039;Maximum script memory size (LSO)&#039;&#039;&#039; - 16384 bytes.&lt;br /&gt;
* &#039;&#039;&#039;Maximum script memory size (Mono)&#039;&#039;&#039; - 65536 bytes (the maximum memory available to Mono scripts can be constrained via [[llSetMemoryLimit]]).&lt;br /&gt;
* &#039;&#039;&#039;Maximum active [[llListen|listeners]] per script&#039;&#039;&#039; - 65.&lt;br /&gt;
** &#039;&#039;&#039;Usable channel for each listener&#039;&#039;&#039; - &#039;&#039;min.&#039;&#039; -2147483648, &#039;&#039;max.&#039;&#039; 2147483647, including the following special channels: [[PUBLIC_CHANNEL]] &#039;&#039;and&#039;&#039; [[DEBUG_CHANNEL]].&lt;br /&gt;
* For specific scripting limits, look up calls in the &#039;&#039;&#039;[[LSL Portal]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== [[Sound]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||Sound length&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|any length &#039;&#039;less than&#039;&#039; 10.0 seconds}}&lt;br /&gt;
| You&#039;re advised to cut longer sounds into 9.9-second-pieces.&lt;br /&gt;
| n/a&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== [[Textures]] ==&lt;br /&gt;
* &#039;&#039;&#039;[http://en.wikipedia.org/wiki/Aspect_ratio Aspect ratios]&#039;&#039;&#039; of profile, place, etc. pictures — all of these were measured at UI size (Edit menu &amp;gt; Preferences &amp;gt; General tab &amp;gt; UI Size) = 1.000:&lt;br /&gt;
&lt;br /&gt;
=== Second Life Viewer 3.6 ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Classifieds thumbnail&#039;&#039;&#039; - ~3:2 (101&amp;amp;times;69 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Classifieds expanded&#039;&#039;&#039; - ~4:3 (159&amp;amp;times;120 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Classifieds expanded &amp;gt; More Info&#039;&#039;&#039; - native aspect ratio&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Destination Guide thumbnail&#039;&#039;&#039; - ~3:2 (101&amp;amp;times;69 pixels) &lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Destination Guide expanded&#039;&#039;&#039; - ~4:3 (159&amp;amp;times;120 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; People&#039;&#039;&#039; - 1:1 (100&amp;amp;times;100 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Places expanded&#039;&#039;&#039; ~4:3 (159&amp;amp;times;120 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Place Profile&#039;&#039;&#039; - ~3:2 (290&amp;amp;times;197 pixels)&lt;br /&gt;
* &#039;&#039;&#039;About Land &amp;gt; Options tab&#039;&#039;&#039; - ~4:3 (195&amp;amp;times;150 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Picture&#039;&#039;&#039; - native aspect ratio; thumbnail cropped to 72&amp;amp;times;72 pixels; zoomed uncropped up to 300&amp;amp;times;300 pixels&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Real world picture&#039;&#039;&#039; - native aspect ratio; thumbnail cropped to 45&amp;amp;times;45 pixels; zoomed uncropped up to 300&amp;amp;times;300 pixels&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Picks thumbnail&#039;&#039;&#039; - 4:3 (60&amp;amp;times;45 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Pick expanded&#039;&#039;&#039; - 4:3 (320&amp;amp;times;240 pixels)&lt;br /&gt;
&lt;br /&gt;
=== 1.x Series Viewers ===&lt;br /&gt;
(official Viewer up to 1.23.5, still used by some [[Alternate viewers|Third Party Viewers]])&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; All for &amp;quot;Classifieds&amp;quot;, &amp;quot;People&amp;quot;, and &amp;quot;Places&amp;quot;&#039;&#039;&#039; - 4:3 (256&amp;amp;times;192 pi&amp;amp;times;els)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Places and Classified tabs&#039;&#039;&#039; - ~7:5 (398&amp;amp;times;282 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Land tab&#039;&#039;&#039; - ~7:5 (358&amp;amp;times;252 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; 2nd Life tab&#039;&#039;&#039; - ~4:3 (178&amp;amp;times;133 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Picks tab&#039;&#039;&#039; - 16:9 (288&amp;amp;times;162 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; 1st Life tab&#039;&#039;&#039; - 1:1 (133&amp;amp;times;133 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Classifieds tab&#039;&#039;&#039; - ~3:2 (206&amp;amp;times;137 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Web tab&#039;&#039;&#039; - 1:1 (400&amp;amp;times;400 pixels)&lt;br /&gt;
** A scrollbar uses 15 pixels on the right-hand side.&lt;br /&gt;
* &#039;&#039;&#039;About Land &amp;gt; Options tab&#039;&#039;&#039; - ~3:2 (178&amp;amp;times;117 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Group Information &amp;gt; General tab&#039;s &amp;quot;Group Insignia&amp;quot;&#039;&#039;&#039; - 1:1 (126&amp;amp;times;126 pixels)&lt;br /&gt;
** Some of these textures are shared (for example, Search &amp;gt; All place pages, Search &amp;gt; Places, and About Land &amp;gt; Options use the same image), so you should pick a well-balanced ratio and size.&lt;br /&gt;
** [[Texture_aspect_ratios|Learn how to get correct texture aspect ratios when editing images.]]&lt;br /&gt;
&lt;br /&gt;
=== All Viewers ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Maximum texture size&#039;&#039;&#039; - 1024&amp;amp;times;1024 pixels&lt;br /&gt;
** All Second Life textures are constrained to [http://en.wikipedia.org/wiki/Power_of_2 powers of 2] (e.g., 128, 256, 512).&lt;br /&gt;
** Some textures inworld have a resolution as high as 2048&amp;amp;times;2048; this is due to a previous limit that was higher.&lt;br /&gt;
** We strongly recommend you use as small textures as possible because larger ones consume more memory and take substantially longer to load.&lt;br /&gt;
** Where large textures are being forced by import to only 512&amp;amp;times;512, lower your ...&amp;gt; Preferences &amp;gt;...&amp;gt; UI Size under 1.0, to increase import size to the max 1024&amp;amp;times;1024.&lt;br /&gt;
&lt;br /&gt;
[[Category:Creation]] [[Category:Tutorials]] [[Category:Lists]]&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
In general 1 byte is enough to contain one character.&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Limits&amp;diff=1196447</id>
		<title>Limits</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Limits&amp;diff=1196447"/>
		<updated>2015-05-09T19:22:47Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: /* Communication */ Note on negative channels from viewer to server&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{KBmaster}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
== Summary ==&lt;br /&gt;
{{RightToc}}&lt;br /&gt;
The Second Life Viewer and simulators have a division of labor, keeping track of the data that makes Second Life run. The Viewer&#039;s job is to:&lt;br /&gt;
&lt;br /&gt;
* Handle locations of objects.&lt;br /&gt;
* Get velocities and other physics information, and does simple physics to keep track of what is moving where.&lt;br /&gt;
&lt;br /&gt;
The simulator&#039;s job is to:&lt;br /&gt;
&lt;br /&gt;
* Run the physics engine.&lt;br /&gt;
* Detect collisions.&lt;br /&gt;
* Keep track of where everything is&lt;br /&gt;
* Send locations of content to the Viewer along with updates when certain changes occur.&lt;br /&gt;
&lt;br /&gt;
Limits are necessary for all of these components to work together. The list below outlines many of the &#039;&#039;&#039;Second Life numerical limits that affect your inworld experience&#039;&#039;&#039;. Some of these will likely change over time, so if you spot something incorrect/outdated, please take a moment to update it.&lt;br /&gt;
&lt;br /&gt;
{{KBcaution|1=The scope of this page is focused on Linden Lab&#039;s official Viewers, keeping in mind [[Third_Party_Viewer_Directory|3rd-party viewers may differ]]. Cite sources and provide substantiation for limits that aren&#039;t provided by Linden Lab. Also, unconfirmed speculation [[Talk:Limits|goes on this discussion page]]. Don&#039;t add data without a hard limit, and don&#039;t add obscure trivia that doesn&#039;t practically affect the general inworld experience.|width=80%}}&lt;br /&gt;
&lt;br /&gt;
== [[Avatar]] ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Max. # of attachments&#039;&#039;&#039; - 38 combined [[HUD]] or body attachments.&lt;br /&gt;
** They can be viewed by right-clicking your avatar and choosing &#039;&#039;&#039;Edit My Outfit&#039;&#039;&#039;.&lt;br /&gt;
** With the formal introduction of [[multiple attachments|multiple attachments to a single point]] in Viewer 2.4, you can attach up to 38 total objects, and they can all be attached to a single point. &lt;br /&gt;
* &#039;&#039;&#039;Max. # of clothing layers&#039;&#039;&#039; including alpha, tattoo, shoe base, physics, socks, gloves, undershirt, underpants, shirt, pants, jacket, skirt&lt;br /&gt;
** On viewers from before the layer limits project: 5 per slot&lt;br /&gt;
** On viewers with revised layer limits: up to 60 total, no per-slot limit. &#039;&#039;As of May 2015, this is only available in candidate viewers.&#039;&#039;&lt;br /&gt;
** In any case, only one each of shape, skin, eyes and hair base may be worn.&lt;br /&gt;
* &#039;&#039;&#039;Max Clothing Texture&#039;&#039;&#039; - 512x512 px (except 128x128 px for eyes) - Server Side Appearance (and legacy baking on outside grids) will downsize larger textures.&amp;lt;!--per Nyx Linden 9/23/2013 Content n Mesh Meeting--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Max. unassisted fly height&#039;&#039;&#039; - Stable hover at current ground elevation &#039;&#039;plus&#039;&#039; 5020m.&lt;br /&gt;
** You can easily acquire a flight attachment to fly high. Also see [[flight limit]] and [[Limits#Navigation|the Navigation section]] below.&lt;br /&gt;
* &#039;&#039;&#039;Common shoe sizes&#039;&#039;&#039; - Traditionally, most women&#039;s shoes were designed for a size 0 (zero) foot. Men&#039;s generally scale up to 14. Newer items (mesh and some sculpted) replace the system feet or conform to the avatar&#039;s shape, so adjustments may be necessary.&lt;br /&gt;
** You can check this by going to Edit menu &amp;gt; Appearance and clicking on the Shape &amp;gt; Legs tab.&lt;br /&gt;
&amp;lt;!--Can someone verify the following?&lt;br /&gt;
* &#039;&#039;&#039;Min. length of avatar name&#039;&#039;&#039; - 2 for first name, 2 for last name, 5 in total (including the space).--&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Max. length of avatar name&#039;&#039;&#039; - 31 for first name, 31 for last name, 63 in total (including the space).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Max. length of {{LSLGC|Username}}&#039;&#039;&#039; - All lower case and a maximum of 63 including the &#039;.&#039;(eg; firstname.lastname)&lt;br /&gt;
**Older account user names are a combination of the First and last name in lower case separated by a period(.)(eg; lilmix.pixelmaid)&lt;br /&gt;
**Modern user names are a single name(no period)(eg; john1234) - &#039;&#039;&#039;Max.&#039;&#039;&#039; length is 31 characters&lt;br /&gt;
**The {{LSLGC|Legacy Name}}s for modern user names always shows Resident as the last name. So the Max is 40 characters in total for a new avatar&#039;s legacy name(including the space and last name &#039;Resident&#039;)&lt;br /&gt;
*&#039;&#039;&#039;Min. length of [[Display_Names]]&#039;&#039;&#039; - At least one script character&lt;br /&gt;
*&#039;&#039;&#039;Max. length of Display Names&#039;&#039;&#039; - 31 characters&lt;br /&gt;
**Display Names can include most Unicode script characters, spaces, and some punctuation.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Max. avatar speed&#039;&#039;&#039; - 250m/s (with only attachments to assist)&lt;br /&gt;
* &#039;&#039;&#039;Max. teleport speed&#039;&#039;&#039;&amp;lt;!-- - 3 teleports per 15 seconds (server 1.27.0) and 10 teleports per 15 seconds (server 1.27.1)--&amp;gt; - 10 teleports per 15 seconds, since SL server 1.27.1&lt;br /&gt;
&lt;br /&gt;
== [[Animation]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||Length of animation&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|60.0 seconds}}&lt;br /&gt;
| Limited by length or Size, whichever is reached first&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Size of Animation&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|120k bytes}}&lt;br /&gt;
| Limited by length or Size, whichever is reached first. Size is after conversion to SL [[Internal Animation Format|internal animaton format]], not BVH source which can be much larger.&lt;br /&gt;
| n/a&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
||animation priority&lt;br /&gt;
| {{no|0}}&lt;br /&gt;
| {{no|4, with custom tools 6}}&lt;br /&gt;
| n/a&lt;br /&gt;
| [[Animation_Priority]]&lt;br /&gt;
|-&lt;br /&gt;
||Number of unique joints per animation&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|32}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== [http://community.secondlife.com/t5/English-Knowledge-Base/Build-Tools/ta-p/700039 Building] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||[[Prim]] dimensions&lt;br /&gt;
| {{no|&amp;lt;0.01,&amp;amp;nbsp;0.01,&amp;amp;nbsp;0.01&amp;gt;}}&lt;br /&gt;
| {{no|&amp;lt;64.0, 64.0, 64.0&amp;gt;}}&lt;br /&gt;
| Used to be &amp;lt;10.0, 10.0, 10.0&amp;gt; prior to Second Life Server version 11.08.17.238770&lt;br /&gt;
| [[llSetScale]], [[PRIM_SIZE]] and [[Megaprim]]&lt;br /&gt;
|-&lt;br /&gt;
||Number of prims in a linkset&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|256 prims}}&lt;br /&gt;
| Used to be 255 prior to Second Life Server version 1.26&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Linking distance&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|[[Linkability_Rules]]}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||[[Mesh/Mesh_physics#Physics_Resource_Cost|Physics cost]] for a physical object&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|32.0}}&lt;br /&gt;
||Additional notes:&lt;br /&gt;
* If you try to link more, it&#039;ll either say &amp;quot;Can&#039;t enable physics for objects with more than 32 primitives&amp;quot; or &amp;quot;Object has too many primitives -- its dynamics have been disabled.&amp;quot;.&lt;br /&gt;
* On server versions 1.38 and below, each sitting avatar counted as 1 prim. From 1.40.2 the limit is only on actual prims.&lt;br /&gt;
| [[OBJECT_PHYSICS_COST]]&lt;br /&gt;
|-&lt;br /&gt;
||Build or rez height&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|4096.0 meters}}&lt;br /&gt;
| 768.0 meters for Viewers prior to version 1.20&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Prim name length&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|63 bytes UTF-8 [[String|string]]}}&lt;br /&gt;
| same limit for {{LSLGC|Avatar/Name|avatar names}}, although the character set for avatar names is significantly limited.&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Prim description length&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|127 bytes UTF-8 [[String|string]]}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Temporary prims&#039; lifetime&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|up to around 60 seconds}}&lt;br /&gt;
| depends upon when the next garbage collector cycle is&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Number of temporary prims&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|RegionPrimLimit - NumberOfPrimsInRegion + Minimum(0.5*RegionPrimLimit, 1000)}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Length of hovertext&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|254 bytes UTF-8 [[String|string]]}}&lt;br /&gt;
| n/a&lt;br /&gt;
| [[llSetText]] and [[PRIM_TEXT]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== [[Communication]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||Whisper distance&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|10 meters}}&lt;br /&gt;
| &amp;lt;code&amp;gt;/whisper&amp;lt;/code&amp;gt; as the first few characters in a message can be used in viewer-2-code based viewers in local chat.&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Chat distance&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|20 meters}}&lt;br /&gt;
| text spoken as a &amp;quot;chat&amp;quot; step &#039;&#039;&#039;within gestures&#039;&#039;&#039; cannot be shouted or whispered. /whisper and /shout &#039;&#039;can&#039;&#039; be used in the &amp;quot;Replace with&amp;quot; field.&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Shout distance&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|100 meters}}&lt;br /&gt;
| &amp;lt;code&amp;gt;/shout&amp;lt;/code&amp;gt; as the first few characters in a message can be used in viewer-2-code based viewers in local chat.&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Length of a chat message and whether or not it is truncated&lt;br /&gt;
| {{no|1 byte or single-byte character}}&lt;br /&gt;
| {{no|1024 bytes or single-byte characters}}&lt;br /&gt;
| Limit does not apply to instant messages via [[llInstantMessage]] and communication between IM and email, the limit there is 1023 bytes or single-byte characters.&lt;br /&gt;
&lt;br /&gt;
The viewer-to-server communication on &#039;&#039;negative&#039;&#039; channels is truncated to 254 bytes. This limit does not affect scripts.&lt;br /&gt;
| [[llInstantMessage]]&lt;br /&gt;
|-&lt;br /&gt;
||Number of offline messages&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|Capped at 25 messages, unless the account has a Premium Subscription, in which case the cap raises to 50 messages.}}&lt;br /&gt;
| Number of offline messages (involving [[IM|IMs]], inventory offers, group notices, group invitations) received before messages get capped. Note: If autoAcceptNewInventory (debug setting) is set to TRUE (the default is FALSE), then all inventory offers, even above 25 (or 50 in the case of Premium members), go directly to inventory and do not count against the cap on offline messages. &lt;br /&gt;
| [[IM]] - [https://community.secondlife.com/t5/Featured-News/A-New-Perk-for-Premium-Subscribers/ba-p/2917357 Blog Post]&lt;br /&gt;
|-&lt;br /&gt;
||Length of a properly delivered email reply to an [[IM]]&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|1023 bytes or single-byte characters}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Time after which a reply to an [[IM]] can be sent via email.&lt;br /&gt;
| {{no|when receiving the IM via email.}}&lt;br /&gt;
| {{no|5 days after receiving the offline IM via email.}}&lt;br /&gt;
| n/a&lt;br /&gt;
| [https://blogs.secondlife.com/community/features/blog/2007/02/06/im-to-e-mail-return-addresses-changing Second Life Blogs]&lt;br /&gt;
|-&lt;br /&gt;
||Time period for which [[IM|IMs]] are stored within Second Life.&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|31 days after receiving the [[IM]]}}&lt;br /&gt;
| [[User:Torley_Linden|Torley Linden]] confirmed this with [[User:Kelly_Linden|Kelly Linden]]&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Number of [[IM|IMs]] sent by an object within an hour&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|5000 per hour}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== [[Gesture]]s ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||Shortcut key mappings&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|33 unique combinations, since {{K|F2}}&amp;amp;ndash;{{K|F12}} can be used with the {{K|Ctrl}} or {{K|Shift}} modifiers.}}&lt;br /&gt;
| n/a&lt;br /&gt;
| [[All_keyboard_shortcut_keys]] and [http://community.secondlife.com/t5/English-Knowledge-Base/Keyboard-shortcuts/ta-p/1086557 the knowledge base]&lt;br /&gt;
|-&lt;br /&gt;
||Chat step length&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|127 bytes or single-byte characters}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Wait time&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|3600 seconds (which is one hour)}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== [[Group]]s ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of groups you can belong to:&#039;&#039;&#039; 42&lt;br /&gt;
** Roles within groups are sort of like sub-groups. In many cases, you can use them instead of creating new groups.&lt;br /&gt;
* &#039;&#039;&#039;Minimum number of members in a group:&#039;&#039;&#039; 2&lt;br /&gt;
** A group with only 1 person for 48 hours will be disbanded (cancelled). Unless the group owns land.&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of roles allowed in a group:&#039;&#039;&#039; 10 (including &amp;quot;Owners&amp;quot; and &amp;quot;Everyone&amp;quot;, which cannot be deleted)&lt;br /&gt;
* &#039;&#039;&#039;Maximum Group Name:&#039;&#039;&#039; 35 single-byte characters.&lt;br /&gt;
* &#039;&#039;&#039;Maximum Group Title:&#039;&#039;&#039; 20 single-byte characters.&lt;br /&gt;
* &#039;&#039;&#039;Maximum Length of a Group Notice:&#039;&#039;&#039; 512 single-byte characters.&lt;br /&gt;
&lt;br /&gt;
== [[Inventory]] ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of inventory items that can be sent in a folder:&#039;&#039;&#039; 42&lt;br /&gt;
** Folders count as items too. This has more to do with packet size limits than cheeky Douglas Adams references.&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of inventory items that can be contained in a prim:&#039;&#039;&#039; None, but more items increase the loading time when you open it.&lt;br /&gt;
* &#039;&#039;&#039;Maximum characters in an inventory item name:&#039;&#039;&#039; 63&lt;br /&gt;
* &#039;&#039;&#039;Maximum notecard line:&#039;&#039;&#039; None, but scripts can only read the first 255 bytes.&lt;br /&gt;
* &#039;&#039;&#039;Maximum notecard size:&#039;&#039;&#039; 65,536 bytes&lt;br /&gt;
* &#039;&#039;&#039;Number of items in the Library:&#039;&#039;&#039; 1,248 as of 2010-06-17&lt;br /&gt;
* &#039;&#039;&#039;Number of items in the Library:&#039;&#039;&#039; 2,210 as of 2012-11-04&lt;br /&gt;
** Verified by [[How_does_the_Library_work|hiding the Library]] and counting the difference.&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of inventory items displayed in a single inventory folder:&#039;&#039;&#039; Several thousand. &amp;lt;!-- not a specific item count, because the data is variable size, but still useful to document that there is a limit. --&amp;gt;&lt;br /&gt;
** This was discussed during [http://wiki.secondlife.com/wiki/Simulator_User_Group/Transcripts/2011.03.08] &amp;quot;the folder will load up to the limit number of items, and remaining ones won&#039;t show up in the viewer. you still own them, they aren&#039;t lost, but they will be hidden until the folder size is reduced.&amp;quot;&lt;br /&gt;
** There is no specified limit for total avatar inventory, very large folders can be split.&lt;br /&gt;
** There was discussion in the Third Party Developers&#039; UG (4/10/2015) meeting about new inventory and login problems from having large numbers of items in a single folder. AISv3 &#039;&#039;removed&#039;&#039; server side limits on the number of items in a folder. Flat inventories are bad. No one is certain at what number of items in a folder cause a login problem. The fix is to clear the inventory cache (not the viewer cache) and log into a deserted, empty region then move inventory items into folders and sub-folders. - The problem appears at different a number of items depending on your computer and connection speed. Hopefully being on an empty region will give one enough edge to get logged in and do some corrective work before being dropped.&lt;br /&gt;
&lt;br /&gt;
== [[Land]] ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Maximum [[Land#Parcel|parcel]] size:&#039;&#039;&#039; 65,536 meters²&lt;br /&gt;
** Covering a whole region, or square on the World Map.&lt;br /&gt;
* &#039;&#039;&#039;Minimum parcel size:&#039;&#039;&#039; 16 meters²&lt;br /&gt;
* &#039;&#039;&#039;Maximum parcel name length:&#039;&#039;&#039; 63 single-byte characters&lt;br /&gt;
* &#039;&#039;&#039;Maximum parcel description length:&#039;&#039;&#039; 255 characters&lt;br /&gt;
* &#039;&#039;&#039;Region name length:&#039;&#039;&#039; Under Linden Concierge policy, minimum of 3 characters, and a maximum of 25 characters (including spaces). See [[Linden Lab Official:Guidelines for Private Region Naming|Guidelines for Private Region Naming]].&lt;br /&gt;
** Rare exceptions exist, like [http://slurl.com/secondlife/X/128/128/24 X].&lt;br /&gt;
* &#039;&#039;&#039;Maximum ban line height for &amp;quot;no entry&amp;quot; or &amp;quot;pay to access&amp;quot;&#039;&#039;&#039; (in other words, &amp;quot;allow public access&amp;quot; is turned off, or &amp;quot;allow group access&amp;quot; is turned on, in the parcel options) is the parcel&#039;s ground elevation &#039;&#039;plus&#039;&#039; 50 meters. If a user is &#039;&#039;&#039;explicitly banned by name&#039;&#039;&#039;, the height is the parcel&#039;s ground elevation &#039;&#039;plus&#039;&#039; 5000 meters. On current viewers this is visible to the full extent.&lt;br /&gt;
* &#039;&#039;&#039;Maximum prims in a [[Land#Region|region]]:&#039;&#039;&#039;&lt;br /&gt;
** Full region: 15,000&lt;br /&gt;
** [[Land#Homestead|Homestead]]: 3,750&lt;br /&gt;
** [[Land#Openspace|Openspace]]: 750&lt;br /&gt;
* &#039;&#039;&#039;Maximum auto return value&#039;&#039;&#039;: Besides &amp;quot;0&amp;quot; (which means &#039;&#039;never&#039;&#039;), {{HoverText|999,999|Almost 23 months}} minutes is the highest auto return value.&lt;br /&gt;
* &#039;&#039;&#039;Terraforming limits:&#039;&#039;&#039;&lt;br /&gt;
** Most mainland can be raised/lowered by 4 meters (+/-).&lt;br /&gt;
** Some mainland cannot be terraformed, including: Bay City regions, Boardman, Brown, De Haro, Kama City regions, Nautilus City regions, Nova Albion regions, and Shermerville regions.&lt;br /&gt;
** [http://community.secondlife.com/t5/English-Knowledge-Base/Linden-Homes/ta-p/700103 Linden Homes] do not allow terraforming.&lt;br /&gt;
** A few, very old mainland Regions like Da Boom have a terraform range of 40 meters (+/-).&lt;br /&gt;
** Estate (private island) terraformability is settable to a maximum of 100 meters (+/-) by the estate owner or managers.&lt;br /&gt;
* &#039;&#039;&#039;Maximum water height:&#039;&#039;&#039; 100 meters using inworld controls, 255 meters by using a *.raw file upload.&lt;br /&gt;
** Region water height is usually 20 meters, and adjacent regions should have the same water height, or else they will look discontinuous.&lt;br /&gt;
* &#039;&#039;&#039;Maximum terrain height:&#039;&#039;&#039; 255 meters using inworld controls (mainland limit), 510 meters by using a *.raw file upload.&lt;br /&gt;
* &#039;&#039;&#039;Miscellaneous estate limits:&#039;&#039;&#039; You can have a maximum of 10 estate managers, 500 allowed Residents, 63 allowed groups, and 500 banned Residents.&lt;br /&gt;
** See World menu &amp;gt; Region/Estate &amp;gt; Estate tab.&lt;br /&gt;
* &#039;&#039;&#039;Maximum number of agents&#039;&#039;&#039;&lt;br /&gt;
** Full region: 100 (Typically set to 40 on mainland, 55 on Linden Homes regions, but this does vary. Some meeting areas have this set to 60 and higher.)&lt;br /&gt;
*** Recent server performance improvements make regions with 60 agents in them perform quite well.&lt;br /&gt;
** [[Land#Homestead|Homestead]]: 20&lt;br /&gt;
** [[Land#Openspace|Openspace]]: 10&lt;br /&gt;
* &#039;&#039;&#039;Freeze Time:&#039;&#039;&#039; Land owners can [[freeze]] other Residents for up to 30 seconds.  Members of land owning groups can also be granted this ability.&lt;br /&gt;
* &#039;&#039;&#039;Minimum parcel that can be listed in Places or All search:&#039;&#039;&#039; 144 meters² &amp;lt;!-- 128 and under are disabled --&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Minimum parcel that can be listed in Events:&#039;&#039;&#039; 512 meters²&lt;br /&gt;
* &#039;&#039;&#039;Maximum altitude for event listings:&#039;&#039;&#039;  768 meters ({{JIRA|WEB-814}})&lt;br /&gt;
* &#039;&#039;&#039;Maximum heights that objects can be seen on the [[World Map]]:&#039;&#039;&#039; 400.005m&lt;br /&gt;
&lt;br /&gt;
== [[Mesh]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||Number of vertices&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|65536 vertices per LOD for each [[mesh]] - See [[Talk:Limits#Mesh_Limits|discussion page]]}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||COLLADA file size&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|Maximum mesh asset size after compression is 8 MB, roughly equivalent to a 256 MB Raw COLLADA file.}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Bone influence weights per vertex&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|4}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Number of materials per mesh&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|8}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Number of materials per face&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|1}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
||Physics weight for a vehicle&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|32.0}}&lt;br /&gt;
| n/a&lt;br /&gt;
| n/a&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===User Found Temporary Mesh limits:===&lt;br /&gt;
&#039;&#039;Because of an apparent bug in the importer stay within these limits.&#039;&#039;&lt;br /&gt;
* 174,752 triangles, beyond which additional triangles will appear as holes.&lt;br /&gt;
* The 64k vertices per material is pre-empted by a limit of 21,844 triangles per material, which is presently reported as {{Jira|BUG-1001}}. (4/2014 - See [[Talk:Limits#Mesh_Limits|discussion page]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:: The import process will continue making new materials beyond 8 x 21,844 (=174,752) triangles, but the extra triangles then get dropped by the limitation to 8 materials, causing holes in the resulting object. Over the 21,844 triangle limit, the vertex count will start to climb steeply, even with smooth shading, because the materials get highly interspersed. So the same vertices have to appear in multiple material lists. So the moral of the story is to stay below 21,844 triangles per material, for now, if you want to avoid some unexpected effects.&lt;br /&gt;
&lt;br /&gt;
== Misc. ==&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;[https://secondlife.com/currency/describe-limits.php Billing and Trading Limits]&#039;&#039;&#039; - Includes [https://secondlife.com/whatis/economy-market.php LindeX] currency exchange limits.&lt;br /&gt;
*&#039;&#039;&#039;Contacts in Communication &amp;gt; Friends tab &#039;&#039;&#039; - A maximum of 20 simultaneous contacts can be selected to change permissions, remove, or invite for a conference chat.&lt;br /&gt;
&lt;br /&gt;
== Navigation ==&lt;br /&gt;
&lt;br /&gt;
[[File:Max Alt.jpg|thumb|right|435px|&#039;&#039;&#039;Height counter error above 2147483647 meters&#039;&#039;&#039;]]&lt;br /&gt;
* &#039;&#039;&#039;Absolute height limit:&#039;&#039;&#039; [http://en.wikipedia.org/wiki/2147483647#2147483647_in_computing 2147483647]&amp;amp;nbsp;=&amp;amp;nbsp;2&amp;lt;sup&amp;gt;31&amp;lt;/sup&amp;gt;&amp;amp;nbsp;−&amp;amp;nbsp;1 meters, which causes the altitude counter to roll over. Altitudes well below this cause graphics errors probably due to limited floating point number precision.&lt;br /&gt;
* &#039;&#039;&#039;Highest z-value of an [[SLurl]], that will still teleport you to a positive altitude:&#039;&#039;&#039; 4096&lt;br /&gt;
** This used to be much higher, but is clamped in late model viewers.&lt;br /&gt;
&lt;br /&gt;
== [[Profile]] ==&lt;br /&gt;
&lt;br /&gt;
Each 7-bit ASCII character is encoded in one byte. International characters might need more bytes. When pasting text instead of typing, you can get in one byte more into each of the below.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;2nd Life tab&#039;s About field&#039;&#039;&#039; - 510 bytes&lt;br /&gt;
* &#039;&#039;&#039;Picks tab&#039;&#039;&#039; - 10 picks with 1022 bytes each&lt;br /&gt;
* &#039;&#039;&#039;1st Life tab&#039;s Info field&#039;&#039;&#039; - 253 bytes&lt;br /&gt;
* &#039;&#039;&#039;Classified tab&#039;&#039;&#039; - 100 listings with x bytes each&lt;br /&gt;
* &#039;&#039;&#039;My Notes&#039;&#039;&#039; - 1022 bytes&lt;br /&gt;
&lt;br /&gt;
== Performance ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Healthy Viewer FPS&#039;&#039;&#039; - Generally, FPS above 15 is good. The higher it gets, the smoother. You can check via [[Advanced]] menu &amp;gt; Performance Tools &amp;gt; Lag Meter, or for more advanced usage, see Advanced &amp;gt; Performance Tools &amp;gt; Statistics Bar.&lt;br /&gt;
* &#039;&#039;&#039;Avatar Rendering Cost scores&#039;&#039;&#039; - [[Avatar Rendering Cost|Learn all about it!]]&lt;br /&gt;
&lt;br /&gt;
== [[Scripting]] == &amp;lt;!-- Important scripting limits should be placed here, less important ones should be in the articles Caveats or Specification sections --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Height at which scripts reactivate on a no-script parcel&#039;&#039;&#039; - 50 m above terrain mesh. Scripted objects that take controls will keep running when you fly down or enter a no-script parcel. (If scripts are disabled in the region debug panel, they will not run at any height.)&lt;br /&gt;
* &#039;&#039;&#039;Maximum height where scripts can run&#039;&#039;&#039; - none, as long as the object remains rezzed or attached.&lt;br /&gt;
* &#039;&#039;&#039;Maximum script source code size&#039;&#039;&#039; - 65536 single byte characters (that&#039;s a viewer limit and can be changed in the config file &#039;panel_script_ed.xml&#039;).&lt;br /&gt;
* &#039;&#039;&#039;Maximum script memory size (LSO)&#039;&#039;&#039; - 16384 bytes.&lt;br /&gt;
* &#039;&#039;&#039;Maximum script memory size (Mono)&#039;&#039;&#039; - 65536 bytes (the maximum memory available to Mono scripts can be constrained via [[llSetMemoryLimit]]).&lt;br /&gt;
* &#039;&#039;&#039;Maximum active [[llListen|listeners]] per script&#039;&#039;&#039; - 65.&lt;br /&gt;
** &#039;&#039;&#039;Usable channel for each listener&#039;&#039;&#039; - &#039;&#039;min.&#039;&#039; -2147483648, &#039;&#039;max.&#039;&#039; 2147483647, including the following special channels: [[PUBLIC_CHANNEL]] &#039;&#039;and&#039;&#039; [[DEBUG_CHANNEL]].&lt;br /&gt;
* For specific scripting limits, look up calls in the &#039;&#039;&#039;[[LSL Portal]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== [[Sound]] ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; width=&amp;quot;100%&amp;quot; {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
! &#039;&#039;&#039;Limit affects&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Lower limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Upper limit&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Comment&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;More coverage&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
||Sound length&lt;br /&gt;
| n/a&lt;br /&gt;
| {{no|any length &#039;&#039;less than&#039;&#039; 10.0 seconds}}&lt;br /&gt;
| You&#039;re advised to cut longer sounds into 9.9-second-pieces.&lt;br /&gt;
| n/a&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== [[Textures]] ==&lt;br /&gt;
* &#039;&#039;&#039;[http://en.wikipedia.org/wiki/Aspect_ratio Aspect ratios]&#039;&#039;&#039; of profile, place, etc. pictures — all of these were measured at UI size (Edit menu &amp;gt; Preferences &amp;gt; General tab &amp;gt; UI Size) = 1.000:&lt;br /&gt;
&lt;br /&gt;
=== Second Life Viewer 3.6 ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Classifieds thumbnail&#039;&#039;&#039; - ~3:2 (101&amp;amp;times;69 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Classifieds expanded&#039;&#039;&#039; - ~4:3 (159&amp;amp;times;120 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Classifieds expanded &amp;gt; More Info&#039;&#039;&#039; - native aspect ratio&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Destination Guide thumbnail&#039;&#039;&#039; - ~3:2 (101&amp;amp;times;69 pixels) &lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Destination Guide expanded&#039;&#039;&#039; - ~4:3 (159&amp;amp;times;120 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; People&#039;&#039;&#039; - 1:1 (100&amp;amp;times;100 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Places expanded&#039;&#039;&#039; ~4:3 (159&amp;amp;times;120 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Place Profile&#039;&#039;&#039; - ~3:2 (290&amp;amp;times;197 pixels)&lt;br /&gt;
* &#039;&#039;&#039;About Land &amp;gt; Options tab&#039;&#039;&#039; - ~4:3 (195&amp;amp;times;150 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Picture&#039;&#039;&#039; - native aspect ratio; thumbnail cropped to 72&amp;amp;times;72 pixels; zoomed uncropped up to 300&amp;amp;times;300 pixels&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Real world picture&#039;&#039;&#039; - native aspect ratio; thumbnail cropped to 45&amp;amp;times;45 pixels; zoomed uncropped up to 300&amp;amp;times;300 pixels&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Picks thumbnail&#039;&#039;&#039; - 4:3 (60&amp;amp;times;45 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Pick expanded&#039;&#039;&#039; - 4:3 (320&amp;amp;times;240 pixels)&lt;br /&gt;
&lt;br /&gt;
=== 1.x Series Viewers ===&lt;br /&gt;
(official Viewer up to 1.23.5, still used by some [[Alternate viewers|Third Party Viewers]])&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; All for &amp;quot;Classifieds&amp;quot;, &amp;quot;People&amp;quot;, and &amp;quot;Places&amp;quot;&#039;&#039;&#039; - 4:3 (256&amp;amp;times;192 pi&amp;amp;times;els)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Places and Classified tabs&#039;&#039;&#039; - ~7:5 (398&amp;amp;times;282 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Search &amp;gt; Land tab&#039;&#039;&#039; - ~7:5 (358&amp;amp;times;252 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; 2nd Life tab&#039;&#039;&#039; - ~4:3 (178&amp;amp;times;133 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Picks tab&#039;&#039;&#039; - 16:9 (288&amp;amp;times;162 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; 1st Life tab&#039;&#039;&#039; - 1:1 (133&amp;amp;times;133 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Classifieds tab&#039;&#039;&#039; - ~3:2 (206&amp;amp;times;137 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Profile &amp;gt; Web tab&#039;&#039;&#039; - 1:1 (400&amp;amp;times;400 pixels)&lt;br /&gt;
** A scrollbar uses 15 pixels on the right-hand side.&lt;br /&gt;
* &#039;&#039;&#039;About Land &amp;gt; Options tab&#039;&#039;&#039; - ~3:2 (178&amp;amp;times;117 pixels)&lt;br /&gt;
* &#039;&#039;&#039;Group Information &amp;gt; General tab&#039;s &amp;quot;Group Insignia&amp;quot;&#039;&#039;&#039; - 1:1 (126&amp;amp;times;126 pixels)&lt;br /&gt;
** Some of these textures are shared (for example, Search &amp;gt; All place pages, Search &amp;gt; Places, and About Land &amp;gt; Options use the same image), so you should pick a well-balanced ratio and size.&lt;br /&gt;
** [[Texture_aspect_ratios|Learn how to get correct texture aspect ratios when editing images.]]&lt;br /&gt;
&lt;br /&gt;
=== All Viewers ===&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Maximum texture size&#039;&#039;&#039; - 1024&amp;amp;times;1024 pixels&lt;br /&gt;
** All Second Life textures are constrained to [http://en.wikipedia.org/wiki/Power_of_2 powers of 2] (e.g., 128, 256, 512).&lt;br /&gt;
** Some textures inworld have a resolution as high as 2048&amp;amp;times;2048; this is due to a previous limit that was higher.&lt;br /&gt;
** We strongly recommend you use as small textures as possible because larger ones consume more memory and take substantially longer to load.&lt;br /&gt;
** Where large textures are being forced by import to only 512&amp;amp;times;512, lower your ...&amp;gt; Preferences &amp;gt;...&amp;gt; UI Size under 1.0, to increase import size to the max 1024&amp;amp;times;1024.&lt;br /&gt;
&lt;br /&gt;
[[Category:Creation]] [[Category:Tutorials]] [[Category:Lists]]&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
In general 1 byte is enough to contain one character.&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Typecast&amp;diff=1195954</id>
		<title>Typecast</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Typecast&amp;diff=1195954"/>
		<updated>2015-03-29T03:29:36Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: Change to using proper tags.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL Header|ml=*}}&lt;br /&gt;
{{LSLC|Syntax}}&lt;br /&gt;
{{RightToc}}&lt;br /&gt;
&lt;br /&gt;
To convert the type of a value a typecast is required. There are two types of typecasting, explicit and implicit. Explicit typecasts must be provided by the programmer, but implicit typecasts are put in place by the compiler. LSL implicitly typecasts strings to keys and integers to floats where the latter type is required but the former is provided.&lt;br /&gt;
{| {{Prettytable|style=float:right; clear:right; margin:0em; line-height:1em; font-size:75%;}}&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;9&amp;quot;| Supported Typecasts&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; rowspan=&amp;quot;2&amp;quot;|&lt;br /&gt;
! colspan=&amp;quot;7&amp;quot; {{Hl2}}|To&lt;br /&gt;
|- align=&amp;quot;center&amp;quot; {{Hl2}}&lt;br /&gt;
![[integer]]&lt;br /&gt;
![[float]]&lt;br /&gt;
![[string]]&lt;br /&gt;
![[key]]&lt;br /&gt;
![[list]]&lt;br /&gt;
![[vector]]&lt;br /&gt;
![[rotation]]&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;7&amp;quot; {{Hl2}}|From&lt;br /&gt;
!{{Hl2}}| [[integer]]&lt;br /&gt;
| x&lt;br /&gt;
| x&lt;br /&gt;
| x&lt;br /&gt;
|&lt;br /&gt;
| x&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
!{{Hl2}}| [[float]]&lt;br /&gt;
| x&lt;br /&gt;
| x&lt;br /&gt;
| x&lt;br /&gt;
|&lt;br /&gt;
| x&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
!{{Hl2}}| [[string]]&lt;br /&gt;
| x&lt;br /&gt;
| x&lt;br /&gt;
| x&lt;br /&gt;
| x&lt;br /&gt;
| x&lt;br /&gt;
| x&lt;br /&gt;
| x&lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
!{{Hl2}}| [[key]]&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| x&lt;br /&gt;
| x&lt;br /&gt;
| x&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
!{{Hl2}}| [[list]]&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| x&lt;br /&gt;
| &lt;br /&gt;
| x&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
!{{Hl2}}| [[vector]]&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| x&lt;br /&gt;
| &lt;br /&gt;
| x&lt;br /&gt;
| x&lt;br /&gt;
| &lt;br /&gt;
|- align=&amp;quot;center&amp;quot;&lt;br /&gt;
!{{Hl2}}| [[rotation]]&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| x&lt;br /&gt;
| &lt;br /&gt;
| x&lt;br /&gt;
| &lt;br /&gt;
| x&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{#vardefine:p_type_desc|variable type&lt;br /&gt;
}}{{#vardefine:p_value_desc|expression or constant&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
== Syntax: ({{LSL Param|type}}){{LSL Param|value}} ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em;&amp;quot;&amp;gt;&lt;br /&gt;
Converts {{LSLP|value}} to {{LSLP|type}}.&lt;br /&gt;
{|&lt;br /&gt;
{{LSL DefineRow|expression|type|{{#var:p_type_desc}}}}&lt;br /&gt;
{{LSL DefineRow|expression|value|{{#var:p_value_desc}}}}&lt;br /&gt;
|}&lt;br /&gt;
If {{LSL Param|value}} is a complex expression, it may be beneficial to wrap it in parentheses. ({{LSL Param|type}})({{LSL Param|value}})&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
== Examples ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
string a = &amp;quot;1.5&amp;quot;;&lt;br /&gt;
float b = (float)a;&lt;br /&gt;
integer c = (integer)a;&lt;br /&gt;
&lt;br /&gt;
integer i;&lt;br /&gt;
i = (integer) 1.23;     // 1&lt;br /&gt;
i = (integer) -1.23;    // -1&lt;br /&gt;
i = (integer) &amp;quot;0123&amp;quot;;   // 123&lt;br /&gt;
i = (integer) &amp;quot;0x12A&amp;quot;;  // 298&lt;br /&gt;
i = (integer) &amp;quot;   -5  &amp;quot;;  // -5; leading white space is ignored&lt;br /&gt;
i = (integer) &amp;quot;105 degrees here, it is a nice day&amp;quot;; // 105; non-numeric text which follows numeric text is ignored&lt;br /&gt;
i = (integer) &amp;quot;String with no numbers&amp;quot;; // 0&lt;br /&gt;
&lt;br /&gt;
float f;&lt;br /&gt;
f = (float) &amp;quot;6.2e1&amp;quot;;   // 62.0&lt;br /&gt;
f = (float) &amp;quot;  -16.2°C is seriously cold!&amp;quot;; // -16.2; (float)string also ignores leading whitespace and trailing non-numeric characters&lt;br /&gt;
// &amp;quot;6.2e1&amp;quot;, &amp;quot;6.2e+1&amp;quot;, &amp;quot;6.2E1&amp;quot;, &amp;quot;6.2E+1&amp;quot; are all equivalent.&lt;br /&gt;
f = (float) &amp;quot;Nancy&amp;quot;;   // any string beginning with &amp;quot;nan&amp;quot; (case insensitive) --&lt;br /&gt;
                       //   Mono only: NaN (not a number); LSO: causes a math error&lt;br /&gt;
f = (float) &amp;quot;infallible LSL!&amp;quot;;   // any string beginning with &amp;quot;inf&amp;quot; (case insensitive) --&lt;br /&gt;
                                 //   Mono only: Infinity; LSO: causes a math error&lt;br /&gt;
&lt;br /&gt;
string s;&lt;br /&gt;
s = (string) -PI;              // &amp;quot;-3.141593&amp;quot; with precision set to 6 decimal places by zero padding or rounding&lt;br /&gt;
s = (string) [1, 2.3, &amp;quot;a&amp;quot;];    // &amp;quot;12.300000a&amp;quot; again 6 decimal places, but ...&lt;br /&gt;
s = (string) &amp;lt;1.0, 2.3, 4.56&amp;gt;; // &amp;quot;&amp;lt;1.00000, 2.30000, 4.56000&amp;gt;&amp;quot; .. now with precision set to 5 decimal places&lt;br /&gt;
s = (string) &amp;lt;2, 4, 0.0, PI &amp;gt;;  // &amp;quot;&amp;lt;2.00000, 4.00000, 0.00000, 3.14159&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
list l;&lt;br /&gt;
l = (list) &amp;quot;&amp;quot;;                // [&amp;quot;&amp;quot;]&lt;br /&gt;
l = (list) &amp;lt;1.0, 2.3, 4.56&amp;gt;;  // [&amp;quot;&amp;lt;1.00000, 2.30000, 4.56000&amp;gt;&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
vector v;&lt;br /&gt;
v = (vector) &amp;quot;&amp;lt;1.0, 2.3, 4.56&amp;gt;&amp;quot;;  // &amp;lt;1.0, 2.3, 4.56&amp;gt;&lt;br /&gt;
v = (vector) &amp;quot;&amp;lt;1.0, 2.3&amp;gt;&amp;quot;;        // ZERO_VECTOR  (Due to insufficient value)&lt;br /&gt;
&lt;br /&gt;
rotation r;&lt;br /&gt;
r = (rotation) &amp;quot;&amp;lt;1.0, 2.3, 4.56, 1.0&amp;gt;&amp;quot;;  // &amp;lt;1.0, 2.3, 4.56, 1.0&amp;gt;&lt;br /&gt;
r = (rotation) &amp;quot;&amp;lt;1.0, 2.3, 4.56&amp;gt;&amp;quot;;       // ZERO_ROTATION  (Due to insufficient value)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Applied===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        integer iUnixTime   = llGetUnixTime(); &lt;br /&gt;
        string  sUnixTime   = (string)unixTime;&lt;br /&gt;
        string  sRegionTime = (string)llGetTimeOfDay();&lt;br /&gt;
        llSetObjectDesc(sUnixTime);&lt;br /&gt;
        llSetText(sRegionTime, &amp;lt;1.0, 0.0 ,0.0&amp;gt;, 1.0);&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
== Caveats ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em;&amp;quot;&amp;gt;&lt;br /&gt;
*The compiler allows explicit typecasting where it is not needed and does not optimize it out. Unnecessary typecasts will bloat code and slow it down.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;box&amp;quot;&amp;gt;&lt;br /&gt;
== Notes ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 0.5em;&amp;quot;&amp;gt;&lt;br /&gt;
*Typecasting from a float to an integer merely removes the portion of the number following the decimal point.  To round to the nearest whole integer, use [[llRound]].&lt;br /&gt;
*For getting at the elements of a list use the {{LSLGC|List/Read Element|llList2*}} functions.&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Talk:LlSensor&amp;diff=1195877</id>
		<title>Talk:LlSensor</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Talk:LlSensor&amp;diff=1195877"/>
		<updated>2015-03-19T18:04:43Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: /* Diameter or Radius? */ No sphere&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{talk}}&lt;br /&gt;
If PI/4 is a 45 degree cone: if the cone&#039;s axis is 1, does the base have a diameter of 2, or a diameter of ~0.82? --[[User:Asha Vultee|Asha Vultee]] 12:53, 19 November 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
:Strictly speaking, it&#039;s not a cone. If you want an idea of what the shape will look like run the following script. -- [[User:Strife Onizuka|Strife Onizuka]] 13:20, 19 November 2007 (PST)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
float arc;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_SPHERE, 0, &amp;lt;0.,1.,0.&amp;gt;, 0.0, &amp;lt;0.,0.,0.&amp;gt;, &amp;lt;0.,arc/PI,0.&amp;gt;]);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Agent? ==&lt;br /&gt;
&lt;br /&gt;
Hey everyone, don&#039;t you think the &amp;quot;AGENT&amp;quot; flag should have a description along the lines of &amp;quot;This is used to find avatars only&amp;quot;. rather than a blank description? I tried to add it myself, but I&#039;m afraid I&#039;m too newbie to understand the formatting... I couldn&#039;t find that particular table.{{unsigned|Hikaru Dreadlow|17:31, 23 June 2008}}&lt;br /&gt;
&lt;br /&gt;
:Will do, the table is in a template ([[Template:LSL_Constants_Sensor]]) so that it can be included on llSensorRepeat too. -- [[User:Strife Onizuka|Strife Onizuka]] 15:02, 23 June 2008 (PDT)&lt;br /&gt;
&lt;br /&gt;
== All Object Sensor? ==&lt;br /&gt;
&lt;br /&gt;
Hey, can anyone tell me how to make an llSensor() that will scan for ANY object? For example, both physical and nonphysical, scripted and nonscripted, any combination. I tried combining all the flags (besides AGENT) with bitwise |, but it didn&#039;t seem to pick up all objects in range.{{unsigned|Crystals Galicia|16:45, 22 September 2008}}&lt;br /&gt;
&lt;br /&gt;
BloodyRain Rang: seems like LL screwed the sensors up cause 0 as type should find all things, even avatars but it doesnt work. And without that it seems impossible to detect any objects without going through all combinations of ACTIVE PASSIVE and SCRIPTED (7 combinations btw). Hope this get fixed someday. (2008-12-08){{unsigned|BloodyRain Rang|18:02, 8 December 2008}}&lt;br /&gt;
&lt;br /&gt;
:My apologies for not catching this sooner (or seeing these comments). The documentation was in error about zero being an acceptable value for &#039;&#039;&#039;type&#039;&#039;&#039;. The error stemmed from the documentation being based initially on the tooltips from the client script editor. Most such errors were caught during the initial import but not all. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 21:21, 8 December 2008 (UTC)&lt;br /&gt;
&lt;br /&gt;
== The return of NULL_KEY caveats are a little lacking ==&lt;br /&gt;
&lt;br /&gt;
The sensor will not trigger if an invalid key (NULL_KEY) is &amp;quot;found&amp;quot; but if the structure of the script allows it the empty NULL_KEY can be returned. As with the simple following.&amp;lt;lsl&amp;gt;default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSensorRepeat(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, 3, 20.0, PI, 1.0);&lt;br /&gt;
    }&lt;br /&gt;
    sensor(integer detected)&lt;br /&gt;
    {&lt;br /&gt;
        llSay(0, (string)llDetectedName(0));&lt;br /&gt;
        llSay(0, (string)llDetectedName(1));&lt;br /&gt;
        llSay(0, (string)llDetectedName(2));&lt;br /&gt;
        llSay(0, (string)llDetectedName(3));&lt;br /&gt;
        llSay(0, (string)llDetectedName(4));&lt;br /&gt;
        llSay(0, (string)llDetectedName(5));&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;I&#039;m not saying this is good scripting but since it returns 5 null keys and 1 avatar (if it only finds one etc.) not being fully aware of the facts while compiling lists for eg. could get messy. Fact: If the event is not structured well to exclude NULL_KEYs they can be returned. -- &#039;&#039;&#039;[[User:EddyFragment Robonaught|Eddy]]&#039;&#039;&#039;  &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:EddyFragment_Robonaught|talk]]|[[Special:Contributions/EddyFragment_Robonaught|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 21:21, 8 August 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Agent&#039;s sit target no longer shows up? ==&lt;br /&gt;
This statement:&lt;br /&gt;
&amp;quot;If the agent is sitting on an object, the root prim of the sat upon object becomes a second sensor target for the agent (but not if the avatar is outside the sensor arc, see SVC-5145[c]).&amp;quot;&lt;br /&gt;
no longer seems to be true - if you search for an agent, you only get the agent, and not the object it&#039;s sitting on. (No clue when this changed, I only tried it for the first time tonight).&lt;br /&gt;
[[User:Redwood Rhiadra|Redwood Rhiadra]] 01:22, 2 October 2010 (UTC)&lt;br /&gt;
: Hi, this feature is definitely confusing, that is what {{Jira|SVC-5145}} is, a request to make the behavior sensible and consistent. I will repeat the tests this weekend and see if it is broken in the same old way or if there are new ways too. --[[User:Cerise Sorbet|Cerise Sorbet]] 03:30, 2 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
__________________________________&lt;br /&gt;
&lt;br /&gt;
== examples on this page are inadequate. == &lt;br /&gt;
&lt;br /&gt;
And no, I don&#039;t dare try to add any more, because Strife the Control Queen doesn&#039;t need examples for himself, so he just deletes them all.&lt;br /&gt;
&lt;br /&gt;
[[User:Chaz Longstaff|Chaz Longstaff]] 18:20, 19 September 2011 (PDT)&lt;br /&gt;
:The ad homimem attack is unnecessary. Taking a look at llListen which is another function that is paired with an event, I added an example script to showcase llSensor with the sensor event. Will that do? --[[User:Nexii Malthus|&amp;lt;span style=&amp;quot;color: #111; text-shadow:-1px -1px #ddd, 1px 1px #888;&amp;quot;&amp;gt;Nexii Malthus&amp;lt;/span&amp;gt;]] 19:45, 19 September 2011 (PDT)&lt;br /&gt;
&lt;br /&gt;
I don&#039;t recall deleting any content recently, let alone an example. I remember once in the last year(or two?) deleting an entirely duplicate example (had been double pasted into the article?) but nothing more recent. So I&#039;m at a bit of a loss for words.&lt;br /&gt;
&lt;br /&gt;
I honestly wish people would post more examples, there is even a category for articles in need of examples: [[:Category:LSL_Needs_Example]] and general improvement [[:Category:LSL FixMe]]. I generally leave writing examples to others, not because I don&#039;t find them useful, I often can&#039;t think of a simple useful example, my examples tend to bury the usage in a script that is better placed in the Script Library (which no one ever sees or uses). I don&#039;t spend much time here and less time in SL, so I&#039;m pretty cautious with my edits and unlikely to edit an example or script.&lt;br /&gt;
&lt;br /&gt;
So I&#039;m Currently working my way through the new functions and features from [[Release_Notes/Second_Life_RC_LeTigre/11#11.09.09.240509]] but I don&#039;t have a lot of time to devote to it. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 13:21, 20 September 2011 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Error with sensor page ==&lt;br /&gt;
&lt;br /&gt;
has anybody noticed that the sensor page shows up odd when not loged into the wiki?[[User:Tmzasz Luminos|Tmzasz Luminos]] 20:15, 14 February 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
:What browser are you using? -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 12:21, 15 February 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
:Never mind, it&#039;s definitely a wiki engine issue. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 12:31, 15 February 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
:{{Jira|WEB-4489}} -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 10:34, 17 February 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
== AGENT vs AGENT_BY_LEGACY_NAME - No ambiguity if there&#039;s no name to filter by ==&lt;br /&gt;
&lt;br /&gt;
The docs say: &amp;quot;If name, id, and/or type are empty or 0, they are ignored.&amp;quot; In that case, the name is empty, it&#039;s ignored and not to be interpreted in any meaningful way. There is no possible ambiguity on how the name should be interpreted because there is no name to filter by. And please explain the removal of the text about how adding a name affects the result. It was a good example of how to use AGENT_BY_LEGACY_NAME to resolve the ambiguity. Maybe a fictitious name should be used instead of an existing one to prevent self-promotion. I&#039;d agree with that, but that name wasn&#039;t even touched. I don&#039;t understand the reversal. -- [[User:Sei Lisa|Sei Lisa]] 10:00, 22 October 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
: I think the example text rollback was an oversight. I shall put it back. I agree, we should choose someone else, for kicks we could make it the last person who edits the page. Thoughts?&lt;br /&gt;
: I&#039;m going to split hairs a bit, the ambiguity does not go away, it just becomes meaningless. However when you edit the code to add a name, that is when the ambiguity matters and where AGENT bite you in the butt. I&#039;d really would like to kill [[AGENT]] off to rid us of this problem. With AGENT we save in letters typed but we get burned by creating a lovely little &amp;quot;Gotcha&amp;quot;: For the new users they would see the three flags and expect [[AGENT]] to be the generic form that allows you to search by either and most likely to be the one that searches by display name. No [[AGENT]], no misunderstanding in the mind of the reader. Hopefully when they encounter [[AGENT]] it will be on the documentation. Regardless, I find using the longer name with the null case distasteful but something I think is worth inflicting on new users. Like using [[run_time_permissions]].&lt;br /&gt;
: Your gallery solution is the most practical of them all. I not happy with how gallery breaks things but recreating gallery with templates is something I&#039;m going to avoid.  -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 21:39, 22 October 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
:: On names: using either a famous Linden name or a fictitious name feels better than a variable one. Governor Linden is one I&#039;m considering, and John Doe is another. I&#039;d lean towards the latter.&lt;br /&gt;
:: On the gallery: What I miss with the gallery is a reference in the text that says where to find it (&amp;quot;look at the bottom of this page...&amp;quot;)&lt;br /&gt;
:: On the edit: Given that I have yet to see one use case for AGENT_BY_USERNAME, I would aim for readability, and AGENT is preferable not because it&#039;s shorter, but because it doesn&#039;t confuse with something that is very rarely if at all there (the username or the legacy name). Once you put a name, if that ever happens, which I doubt, especially for a new user, you can change it to the correct type of name. And of course, you can not &amp;quot;kill&amp;quot; AGENT, because AGENT_BY_USERNAME does simply not work at all with llDetectedType, and AGENT_BY_LEGACY_NAME is very clearly a misname for that case. The flags are shared with llDetectedType and there&#039;s even no indication in that page that AGENT_BY_USERNAME won&#039;t work at all with it. That is a separate issue, but the logic that leads to preferring AGENT there also applies to prefer AGENT when no name is specified in llSensor. -- [[User:Sei Lisa|Sei Lisa]] 01:16, 23 October 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;rant&amp;gt; I consider the introduction of AGENT_BY_LEGACY_NAME a mistake. The whole display name system has been a hack on top of the existing, now &amp;quot;legacy&amp;quot; name system, including the LSL additions. The same logic that led to the introduction of AGENT_BY_LEGACY_NAME should for example have led to deprecating llKey2Name and introducing llGetLegacyName as a synonym, yet that didn&#039;t happen. People are expected to know that llKey2Name returns a legacy name and not a display name or username. It shouldn&#039;t be any different with AGENT; just adding AGENT_BY_USERNAME to provide access to the new functionality should have been enough. The mere presence of AGENT_BY_LEGACY_NAME has proven to introduce more confusion than the one caused by forgetting to change it to AGENT_BY_USERNAME when using a username in the name (again, if that ever happens). The problem is that it references a name where it isn&#039;t applicable, leaving the reader of the code wondering: &amp;quot;Name? What name?&amp;quot; It&#039;s akin to giving instructions to someone having a step that is not applicable at all. Imagine telling someone &amp;quot;Go straight through this street; turn right when you see a sign that says &#039;X&#039;, and turn left when you see a sign that says &#039;Y&#039;&amp;quot; but there is only an &#039;Y&#039; sign and all that is needed to reach the destination is to turn left when reaching it. The instructions are logically impeccable, and anyone following them literally will reach the destination, but the receiver will wonder where is that &#039;X&#039; sign. That&#039;s what I feel every time I see a llSensor call using &amp;quot;&amp;quot; as name and AGENT_BY_LEGACY_NAME as constant. If one is to be killed, it&#039;s AGENT_BY_LEGACY_NAME, not AGENT. &amp;lt;/rant&amp;gt;&lt;br /&gt;
:: There, I said it. To elaborate on shortness, being shorter is not at all a reason to prefer it. I really wish that it at least had a namespace prefix like SENSOR_ or OBJECT_TYPE_ or the like, to reduce the chance of name collisions and clarify the scope of its applicability. It doesn&#039;t, sadly. -- [[User:Sei Lisa|Sei Lisa]] 02:00, 23 October 2013 (PDT)&lt;br /&gt;
:::Good point about directions.&lt;br /&gt;
:::llDetectedType: I&#039;ll poke the template so it does not show the AGENT_* constants there, only AGENT. I really wish they had prefixed them, also the texture animation constants, who would guess [[PING_PONG]] was a texture animation constant without looking it up? LSL was built before it was designed. Personally it all have been better if LSL was object oriented, you wouldn&#039;t have had so many silly lookup functions.&lt;br /&gt;
:::Governor Linden was actually who I was thinking of, that or Philip Linden. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 10:59, 23 October 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
::::I have to agree with Sei on this one. It is clearly silly to say you are searching by a name when that is exactly what you are not doing. Like it or not, AGENT exists, and we should demonstrate it. I will continue to use AGENT where appropriate for as long as it compiles. I also belong to the school that feels that the whole display name idea was a stupid mistake. [[User:Omei Qunhua|Omei Qunhua]] 12:52, 23 October 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
:::: @ Strife:&lt;br /&gt;
:::: On names: While I still would lean towards John Doe, I have no strong opinion; Governor Linden is fine with me. Philip Linden could potentially have political issues in future, I hope not.&lt;br /&gt;
:::: On prefixes: Sad thing is they made the same mistake recently when they introduced HORIZONTAL and VERTICAL for pathfinding. Talk about namespace pollution. Oh, well.&lt;br /&gt;
:::: On the change: would you consider re-applying my changes then?&lt;br /&gt;
:::: @ Omei: Thanks for the support :) I wouldn&#039;t go as far as calling it a stupid mistake, but it&#039;s a hack no matter how good or bad idea it is. -- [[User:Sei Lisa|Sei Lisa]] 13:20, 23 October 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
:::: Thanks for the change, very appreciated! -- [[User:Sei Lisa|Sei Lisa]] 10:05, 24 October 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
::::: You are welcome. I would be ok with causing a little political uproar. Streisand effect, would be good for the wiki. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 22:01, 25 October 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Diameter or Radius? ==&lt;br /&gt;
&lt;br /&gt;
Why does this functions wiki page not explicitly state weather the float RANGE, is a Diameter, or a Radius?&lt;br /&gt;
&lt;br /&gt;
Just calling it a Range, seems kinda ambiguous. Sure many of us can just assume, or experiment to be sure. But it seems like info that belongs on the upper most definition of the function. &lt;br /&gt;
&lt;br /&gt;
Maybe I&#039;m just missing it due to sleep deprivation. [[User:ThumpieBunnyEve Hax|ThumpieBunnyEve Hax]] ([[User talk:ThumpieBunnyEve Hax|talk]]) 15:23, 18 March 2015 (PDT)&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Range&amp;quot; means distance from the prim&#039;s or the wearer&#039;s center. That forms a sphere around said center, with the range&#039;s radius, within which everything is &amp;quot;in range&amp;quot; and everything outside is &amp;quot;out of range&amp;quot;. Therefore it is the radius. --[[User:Pedro Oval|Pedro Oval]] ([[User talk:Pedro Oval|talk]]) 04:44, 19 March 2015 (PDT)&lt;br /&gt;
&lt;br /&gt;
::I submit my edit to the page for clarity. I was confident my mention of radius, and &amp;quot;distance from center&amp;quot; was sufficient, valid, and helpful. If it doesn&#039;t get changed back, then yay for a positive contribution! [[User:ThumpieBunnyEve Hax|ThumpieBunnyEve Hax]] ([[User talk:ThumpieBunnyEve Hax|talk]]) 07:33, 19 March 2015 (PDT)&lt;br /&gt;
&lt;br /&gt;
::: I personally find it more confusing when put that way. It doesn&#039;t state the center of what, or the radius or what geometric figure or why it matters, while &amp;quot;range&amp;quot; is clearly implicitly referring to a distance, which logically must be from the script that has the sensor to the detected object. I don&#039;t know where did your confusion between radius and diameter come from, as not many people will realize immediately that the range volume forms a sphere. My vote is for that change to be reverted. --[[User:Pedro Oval|Pedro Oval]] ([[User talk:Pedro Oval|talk]]) 08:57, 19 March 2015 (PDT)&lt;br /&gt;
&lt;br /&gt;
:::: I fail to see where saying &amp;quot;Range&amp;quot; by itself is any more descriptive or accurate. It leaves more to the imagination then saying Radius, which by definition indicates from center point, inclusively to an end. Range, in fact can be easily misconstrued as a diameter, a square field, or a point at a variable distance forming a ring. Semantics are important and layman&#039;s terms such as &amp;quot;Range&amp;quot; when referring to a Radius, do not provide enough info for an accurate visualization of the procedure.  I prefer to call a dog &amp;quot;a dog&amp;quot;, rather then &amp;quot;the thing&amp;quot;. One I know not to store in the attic for a few years, the other, not so much. If you don&#039;t understand what the word Radius means, you can easily look it up in a dictionary, but looking up &amp;quot;Range&amp;quot; in a dictionary wont provide you any insight as to weather this process uses a diameter or a radius. In fact many people who I&#039;ve taught scripting to have asked me if &amp;quot;Range&amp;quot; was halved, when the Arc, was PI / 4. Implying they presumed &amp;quot;Range&amp;quot; to be a diameter.  I wonder where they got that notion?? Perhaps it was from the lack of clarity in this functions description. I suppose Ray-Length could be another plausible word. but it&#039;s 2 words. and &amp;quot;Length&amp;quot;, by itself would also not distinguish between diameter and radius as both are a measure of length. [[User:ThumpieBunnyEve Hax|ThumpieBunnyEve Hax]] ([[User talk:ThumpieBunnyEve Hax|talk]]) 09:56, 19 March 2015 (PDT)&lt;br /&gt;
&lt;br /&gt;
::::: {{quote|radius:&lt;br /&gt;
&lt;br /&gt;
1. a straight line from the center to the circumference of a circle or sphere.&lt;br /&gt;
2. the thicker and shorter of the two bones in the human forearm.}}&lt;br /&gt;
There&#039;s no sphere here. There&#039;s a vector that goes from the sensor to the potentially sensed object, whose length can be in-range or out-of-range. And there&#039;s another vector, the X axis of the prim, whose angle with the first vector determines whether the arc is in-range or out-of-range. No idea where your pupils got the concept of radius from, but I&#039;d bet that it&#039;s either from their own imagination or because you introduced it as a sphere in the first place. --[[User:Pedro Oval|Pedro Oval]] ([[User talk:Pedro Oval|talk]]) 11:04, 19 March 2015 (PDT)&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Talk:LlSensor&amp;diff=1195862</id>
		<title>Talk:LlSensor</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Talk:LlSensor&amp;diff=1195862"/>
		<updated>2015-03-19T15:57:43Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: /* Diameter or Radius? */ &amp;quot;Radius&amp;quot; is more confusing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{talk}}&lt;br /&gt;
If PI/4 is a 45 degree cone: if the cone&#039;s axis is 1, does the base have a diameter of 2, or a diameter of ~0.82? --[[User:Asha Vultee|Asha Vultee]] 12:53, 19 November 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
:Strictly speaking, it&#039;s not a cone. If you want an idea of what the shape will look like run the following script. -- [[User:Strife Onizuka|Strife Onizuka]] 13:20, 19 November 2007 (PST)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
float arc;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_SPHERE, 0, &amp;lt;0.,1.,0.&amp;gt;, 0.0, &amp;lt;0.,0.,0.&amp;gt;, &amp;lt;0.,arc/PI,0.&amp;gt;]);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Agent? ==&lt;br /&gt;
&lt;br /&gt;
Hey everyone, don&#039;t you think the &amp;quot;AGENT&amp;quot; flag should have a description along the lines of &amp;quot;This is used to find avatars only&amp;quot;. rather than a blank description? I tried to add it myself, but I&#039;m afraid I&#039;m too newbie to understand the formatting... I couldn&#039;t find that particular table.{{unsigned|Hikaru Dreadlow|17:31, 23 June 2008}}&lt;br /&gt;
&lt;br /&gt;
:Will do, the table is in a template ([[Template:LSL_Constants_Sensor]]) so that it can be included on llSensorRepeat too. -- [[User:Strife Onizuka|Strife Onizuka]] 15:02, 23 June 2008 (PDT)&lt;br /&gt;
&lt;br /&gt;
== All Object Sensor? ==&lt;br /&gt;
&lt;br /&gt;
Hey, can anyone tell me how to make an llSensor() that will scan for ANY object? For example, both physical and nonphysical, scripted and nonscripted, any combination. I tried combining all the flags (besides AGENT) with bitwise |, but it didn&#039;t seem to pick up all objects in range.{{unsigned|Crystals Galicia|16:45, 22 September 2008}}&lt;br /&gt;
&lt;br /&gt;
BloodyRain Rang: seems like LL screwed the sensors up cause 0 as type should find all things, even avatars but it doesnt work. And without that it seems impossible to detect any objects without going through all combinations of ACTIVE PASSIVE and SCRIPTED (7 combinations btw). Hope this get fixed someday. (2008-12-08){{unsigned|BloodyRain Rang|18:02, 8 December 2008}}&lt;br /&gt;
&lt;br /&gt;
:My apologies for not catching this sooner (or seeing these comments). The documentation was in error about zero being an acceptable value for &#039;&#039;&#039;type&#039;&#039;&#039;. The error stemmed from the documentation being based initially on the tooltips from the client script editor. Most such errors were caught during the initial import but not all. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 21:21, 8 December 2008 (UTC)&lt;br /&gt;
&lt;br /&gt;
== The return of NULL_KEY caveats are a little lacking ==&lt;br /&gt;
&lt;br /&gt;
The sensor will not trigger if an invalid key (NULL_KEY) is &amp;quot;found&amp;quot; but if the structure of the script allows it the empty NULL_KEY can be returned. As with the simple following.&amp;lt;lsl&amp;gt;default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSensorRepeat(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, 3, 20.0, PI, 1.0);&lt;br /&gt;
    }&lt;br /&gt;
    sensor(integer detected)&lt;br /&gt;
    {&lt;br /&gt;
        llSay(0, (string)llDetectedName(0));&lt;br /&gt;
        llSay(0, (string)llDetectedName(1));&lt;br /&gt;
        llSay(0, (string)llDetectedName(2));&lt;br /&gt;
        llSay(0, (string)llDetectedName(3));&lt;br /&gt;
        llSay(0, (string)llDetectedName(4));&lt;br /&gt;
        llSay(0, (string)llDetectedName(5));&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;I&#039;m not saying this is good scripting but since it returns 5 null keys and 1 avatar (if it only finds one etc.) not being fully aware of the facts while compiling lists for eg. could get messy. Fact: If the event is not structured well to exclude NULL_KEYs they can be returned. -- &#039;&#039;&#039;[[User:EddyFragment Robonaught|Eddy]]&#039;&#039;&#039;  &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:EddyFragment_Robonaught|talk]]|[[Special:Contributions/EddyFragment_Robonaught|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 21:21, 8 August 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Agent&#039;s sit target no longer shows up? ==&lt;br /&gt;
This statement:&lt;br /&gt;
&amp;quot;If the agent is sitting on an object, the root prim of the sat upon object becomes a second sensor target for the agent (but not if the avatar is outside the sensor arc, see SVC-5145[c]).&amp;quot;&lt;br /&gt;
no longer seems to be true - if you search for an agent, you only get the agent, and not the object it&#039;s sitting on. (No clue when this changed, I only tried it for the first time tonight).&lt;br /&gt;
[[User:Redwood Rhiadra|Redwood Rhiadra]] 01:22, 2 October 2010 (UTC)&lt;br /&gt;
: Hi, this feature is definitely confusing, that is what {{Jira|SVC-5145}} is, a request to make the behavior sensible and consistent. I will repeat the tests this weekend and see if it is broken in the same old way or if there are new ways too. --[[User:Cerise Sorbet|Cerise Sorbet]] 03:30, 2 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
__________________________________&lt;br /&gt;
&lt;br /&gt;
== examples on this page are inadequate. == &lt;br /&gt;
&lt;br /&gt;
And no, I don&#039;t dare try to add any more, because Strife the Control Queen doesn&#039;t need examples for himself, so he just deletes them all.&lt;br /&gt;
&lt;br /&gt;
[[User:Chaz Longstaff|Chaz Longstaff]] 18:20, 19 September 2011 (PDT)&lt;br /&gt;
:The ad homimem attack is unnecessary. Taking a look at llListen which is another function that is paired with an event, I added an example script to showcase llSensor with the sensor event. Will that do? --[[User:Nexii Malthus|&amp;lt;span style=&amp;quot;color: #111; text-shadow:-1px -1px #ddd, 1px 1px #888;&amp;quot;&amp;gt;Nexii Malthus&amp;lt;/span&amp;gt;]] 19:45, 19 September 2011 (PDT)&lt;br /&gt;
&lt;br /&gt;
I don&#039;t recall deleting any content recently, let alone an example. I remember once in the last year(or two?) deleting an entirely duplicate example (had been double pasted into the article?) but nothing more recent. So I&#039;m at a bit of a loss for words.&lt;br /&gt;
&lt;br /&gt;
I honestly wish people would post more examples, there is even a category for articles in need of examples: [[:Category:LSL_Needs_Example]] and general improvement [[:Category:LSL FixMe]]. I generally leave writing examples to others, not because I don&#039;t find them useful, I often can&#039;t think of a simple useful example, my examples tend to bury the usage in a script that is better placed in the Script Library (which no one ever sees or uses). I don&#039;t spend much time here and less time in SL, so I&#039;m pretty cautious with my edits and unlikely to edit an example or script.&lt;br /&gt;
&lt;br /&gt;
So I&#039;m Currently working my way through the new functions and features from [[Release_Notes/Second_Life_RC_LeTigre/11#11.09.09.240509]] but I don&#039;t have a lot of time to devote to it. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 13:21, 20 September 2011 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Error with sensor page ==&lt;br /&gt;
&lt;br /&gt;
has anybody noticed that the sensor page shows up odd when not loged into the wiki?[[User:Tmzasz Luminos|Tmzasz Luminos]] 20:15, 14 February 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
:What browser are you using? -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 12:21, 15 February 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
:Never mind, it&#039;s definitely a wiki engine issue. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 12:31, 15 February 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
:{{Jira|WEB-4489}} -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 10:34, 17 February 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
== AGENT vs AGENT_BY_LEGACY_NAME - No ambiguity if there&#039;s no name to filter by ==&lt;br /&gt;
&lt;br /&gt;
The docs say: &amp;quot;If name, id, and/or type are empty or 0, they are ignored.&amp;quot; In that case, the name is empty, it&#039;s ignored and not to be interpreted in any meaningful way. There is no possible ambiguity on how the name should be interpreted because there is no name to filter by. And please explain the removal of the text about how adding a name affects the result. It was a good example of how to use AGENT_BY_LEGACY_NAME to resolve the ambiguity. Maybe a fictitious name should be used instead of an existing one to prevent self-promotion. I&#039;d agree with that, but that name wasn&#039;t even touched. I don&#039;t understand the reversal. -- [[User:Sei Lisa|Sei Lisa]] 10:00, 22 October 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
: I think the example text rollback was an oversight. I shall put it back. I agree, we should choose someone else, for kicks we could make it the last person who edits the page. Thoughts?&lt;br /&gt;
: I&#039;m going to split hairs a bit, the ambiguity does not go away, it just becomes meaningless. However when you edit the code to add a name, that is when the ambiguity matters and where AGENT bite you in the butt. I&#039;d really would like to kill [[AGENT]] off to rid us of this problem. With AGENT we save in letters typed but we get burned by creating a lovely little &amp;quot;Gotcha&amp;quot;: For the new users they would see the three flags and expect [[AGENT]] to be the generic form that allows you to search by either and most likely to be the one that searches by display name. No [[AGENT]], no misunderstanding in the mind of the reader. Hopefully when they encounter [[AGENT]] it will be on the documentation. Regardless, I find using the longer name with the null case distasteful but something I think is worth inflicting on new users. Like using [[run_time_permissions]].&lt;br /&gt;
: Your gallery solution is the most practical of them all. I not happy with how gallery breaks things but recreating gallery with templates is something I&#039;m going to avoid.  -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 21:39, 22 October 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
:: On names: using either a famous Linden name or a fictitious name feels better than a variable one. Governor Linden is one I&#039;m considering, and John Doe is another. I&#039;d lean towards the latter.&lt;br /&gt;
:: On the gallery: What I miss with the gallery is a reference in the text that says where to find it (&amp;quot;look at the bottom of this page...&amp;quot;)&lt;br /&gt;
:: On the edit: Given that I have yet to see one use case for AGENT_BY_USERNAME, I would aim for readability, and AGENT is preferable not because it&#039;s shorter, but because it doesn&#039;t confuse with something that is very rarely if at all there (the username or the legacy name). Once you put a name, if that ever happens, which I doubt, especially for a new user, you can change it to the correct type of name. And of course, you can not &amp;quot;kill&amp;quot; AGENT, because AGENT_BY_USERNAME does simply not work at all with llDetectedType, and AGENT_BY_LEGACY_NAME is very clearly a misname for that case. The flags are shared with llDetectedType and there&#039;s even no indication in that page that AGENT_BY_USERNAME won&#039;t work at all with it. That is a separate issue, but the logic that leads to preferring AGENT there also applies to prefer AGENT when no name is specified in llSensor. -- [[User:Sei Lisa|Sei Lisa]] 01:16, 23 October 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;rant&amp;gt; I consider the introduction of AGENT_BY_LEGACY_NAME a mistake. The whole display name system has been a hack on top of the existing, now &amp;quot;legacy&amp;quot; name system, including the LSL additions. The same logic that led to the introduction of AGENT_BY_LEGACY_NAME should for example have led to deprecating llKey2Name and introducing llGetLegacyName as a synonym, yet that didn&#039;t happen. People are expected to know that llKey2Name returns a legacy name and not a display name or username. It shouldn&#039;t be any different with AGENT; just adding AGENT_BY_USERNAME to provide access to the new functionality should have been enough. The mere presence of AGENT_BY_LEGACY_NAME has proven to introduce more confusion than the one caused by forgetting to change it to AGENT_BY_USERNAME when using a username in the name (again, if that ever happens). The problem is that it references a name where it isn&#039;t applicable, leaving the reader of the code wondering: &amp;quot;Name? What name?&amp;quot; It&#039;s akin to giving instructions to someone having a step that is not applicable at all. Imagine telling someone &amp;quot;Go straight through this street; turn right when you see a sign that says &#039;X&#039;, and turn left when you see a sign that says &#039;Y&#039;&amp;quot; but there is only an &#039;Y&#039; sign and all that is needed to reach the destination is to turn left when reaching it. The instructions are logically impeccable, and anyone following them literally will reach the destination, but the receiver will wonder where is that &#039;X&#039; sign. That&#039;s what I feel every time I see a llSensor call using &amp;quot;&amp;quot; as name and AGENT_BY_LEGACY_NAME as constant. If one is to be killed, it&#039;s AGENT_BY_LEGACY_NAME, not AGENT. &amp;lt;/rant&amp;gt;&lt;br /&gt;
:: There, I said it. To elaborate on shortness, being shorter is not at all a reason to prefer it. I really wish that it at least had a namespace prefix like SENSOR_ or OBJECT_TYPE_ or the like, to reduce the chance of name collisions and clarify the scope of its applicability. It doesn&#039;t, sadly. -- [[User:Sei Lisa|Sei Lisa]] 02:00, 23 October 2013 (PDT)&lt;br /&gt;
:::Good point about directions.&lt;br /&gt;
:::llDetectedType: I&#039;ll poke the template so it does not show the AGENT_* constants there, only AGENT. I really wish they had prefixed them, also the texture animation constants, who would guess [[PING_PONG]] was a texture animation constant without looking it up? LSL was built before it was designed. Personally it all have been better if LSL was object oriented, you wouldn&#039;t have had so many silly lookup functions.&lt;br /&gt;
:::Governor Linden was actually who I was thinking of, that or Philip Linden. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 10:59, 23 October 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
::::I have to agree with Sei on this one. It is clearly silly to say you are searching by a name when that is exactly what you are not doing. Like it or not, AGENT exists, and we should demonstrate it. I will continue to use AGENT where appropriate for as long as it compiles. I also belong to the school that feels that the whole display name idea was a stupid mistake. [[User:Omei Qunhua|Omei Qunhua]] 12:52, 23 October 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
:::: @ Strife:&lt;br /&gt;
:::: On names: While I still would lean towards John Doe, I have no strong opinion; Governor Linden is fine with me. Philip Linden could potentially have political issues in future, I hope not.&lt;br /&gt;
:::: On prefixes: Sad thing is they made the same mistake recently when they introduced HORIZONTAL and VERTICAL for pathfinding. Talk about namespace pollution. Oh, well.&lt;br /&gt;
:::: On the change: would you consider re-applying my changes then?&lt;br /&gt;
:::: @ Omei: Thanks for the support :) I wouldn&#039;t go as far as calling it a stupid mistake, but it&#039;s a hack no matter how good or bad idea it is. -- [[User:Sei Lisa|Sei Lisa]] 13:20, 23 October 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
:::: Thanks for the change, very appreciated! -- [[User:Sei Lisa|Sei Lisa]] 10:05, 24 October 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
::::: You are welcome. I would be ok with causing a little political uproar. Streisand effect, would be good for the wiki. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 22:01, 25 October 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Diameter or Radius? ==&lt;br /&gt;
&lt;br /&gt;
Why does this functions wiki page not explicitly state weather the float RANGE, is a Diameter, or a Radius?&lt;br /&gt;
&lt;br /&gt;
Just calling it a Range, seems kinda ambiguous. Sure many of us can just assume, or experiment to be sure. But it seems like info that belongs on the upper most definition of the function. &lt;br /&gt;
&lt;br /&gt;
Maybe I&#039;m just missing it due to sleep deprivation. [[User:ThumpieBunnyEve Hax|ThumpieBunnyEve Hax]] ([[User talk:ThumpieBunnyEve Hax|talk]]) 15:23, 18 March 2015 (PDT)&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Range&amp;quot; means distance from the prim&#039;s or the wearer&#039;s center. That forms a sphere around said center, with the range&#039;s radius, within which everything is &amp;quot;in range&amp;quot; and everything outside is &amp;quot;out of range&amp;quot;. Therefore it is the radius. --[[User:Pedro Oval|Pedro Oval]] ([[User talk:Pedro Oval|talk]]) 04:44, 19 March 2015 (PDT)&lt;br /&gt;
&lt;br /&gt;
::I submit my edit to the page for clarity. I was confident my mention of radius, and &amp;quot;distance from center&amp;quot; was sufficient, valid, and helpful. If it doesn&#039;t get changed back, then yay for a positive contribution! [[User:ThumpieBunnyEve Hax|ThumpieBunnyEve Hax]] ([[User talk:ThumpieBunnyEve Hax|talk]]) 07:33, 19 March 2015 (PDT)&lt;br /&gt;
&lt;br /&gt;
::: I personally find it more confusing when put that way. It doesn&#039;t state the center of what, or the radius or what geometric figure or why it matters, while &amp;quot;range&amp;quot; is clearly implicitly referring to a distance, which logically must be from the script that has the sensor to the detected object. I don&#039;t know where did your confusion between radius and diameter come from, as not many people will realize immediately that the range volume forms a sphere. My vote is for that change to be reverted. --[[User:Pedro Oval|Pedro Oval]] ([[User talk:Pedro Oval|talk]]) 08:57, 19 March 2015 (PDT)&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Talk:LlSensor&amp;diff=1195856</id>
		<title>Talk:LlSensor</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Talk:LlSensor&amp;diff=1195856"/>
		<updated>2015-03-19T11:44:42Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: /* Diameter or Radius? */ Radius&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{talk}}&lt;br /&gt;
If PI/4 is a 45 degree cone: if the cone&#039;s axis is 1, does the base have a diameter of 2, or a diameter of ~0.82? --[[User:Asha Vultee|Asha Vultee]] 12:53, 19 November 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
:Strictly speaking, it&#039;s not a cone. If you want an idea of what the shape will look like run the following script. -- [[User:Strife Onizuka|Strife Onizuka]] 13:20, 19 November 2007 (PST)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
float arc;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_SPHERE, 0, &amp;lt;0.,1.,0.&amp;gt;, 0.0, &amp;lt;0.,0.,0.&amp;gt;, &amp;lt;0.,arc/PI,0.&amp;gt;]);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Agent? ==&lt;br /&gt;
&lt;br /&gt;
Hey everyone, don&#039;t you think the &amp;quot;AGENT&amp;quot; flag should have a description along the lines of &amp;quot;This is used to find avatars only&amp;quot;. rather than a blank description? I tried to add it myself, but I&#039;m afraid I&#039;m too newbie to understand the formatting... I couldn&#039;t find that particular table.{{unsigned|Hikaru Dreadlow|17:31, 23 June 2008}}&lt;br /&gt;
&lt;br /&gt;
:Will do, the table is in a template ([[Template:LSL_Constants_Sensor]]) so that it can be included on llSensorRepeat too. -- [[User:Strife Onizuka|Strife Onizuka]] 15:02, 23 June 2008 (PDT)&lt;br /&gt;
&lt;br /&gt;
== All Object Sensor? ==&lt;br /&gt;
&lt;br /&gt;
Hey, can anyone tell me how to make an llSensor() that will scan for ANY object? For example, both physical and nonphysical, scripted and nonscripted, any combination. I tried combining all the flags (besides AGENT) with bitwise |, but it didn&#039;t seem to pick up all objects in range.{{unsigned|Crystals Galicia|16:45, 22 September 2008}}&lt;br /&gt;
&lt;br /&gt;
BloodyRain Rang: seems like LL screwed the sensors up cause 0 as type should find all things, even avatars but it doesnt work. And without that it seems impossible to detect any objects without going through all combinations of ACTIVE PASSIVE and SCRIPTED (7 combinations btw). Hope this get fixed someday. (2008-12-08){{unsigned|BloodyRain Rang|18:02, 8 December 2008}}&lt;br /&gt;
&lt;br /&gt;
:My apologies for not catching this sooner (or seeing these comments). The documentation was in error about zero being an acceptable value for &#039;&#039;&#039;type&#039;&#039;&#039;. The error stemmed from the documentation being based initially on the tooltips from the client script editor. Most such errors were caught during the initial import but not all. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 21:21, 8 December 2008 (UTC)&lt;br /&gt;
&lt;br /&gt;
== The return of NULL_KEY caveats are a little lacking ==&lt;br /&gt;
&lt;br /&gt;
The sensor will not trigger if an invalid key (NULL_KEY) is &amp;quot;found&amp;quot; but if the structure of the script allows it the empty NULL_KEY can be returned. As with the simple following.&amp;lt;lsl&amp;gt;default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSensorRepeat(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, 3, 20.0, PI, 1.0);&lt;br /&gt;
    }&lt;br /&gt;
    sensor(integer detected)&lt;br /&gt;
    {&lt;br /&gt;
        llSay(0, (string)llDetectedName(0));&lt;br /&gt;
        llSay(0, (string)llDetectedName(1));&lt;br /&gt;
        llSay(0, (string)llDetectedName(2));&lt;br /&gt;
        llSay(0, (string)llDetectedName(3));&lt;br /&gt;
        llSay(0, (string)llDetectedName(4));&lt;br /&gt;
        llSay(0, (string)llDetectedName(5));&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;I&#039;m not saying this is good scripting but since it returns 5 null keys and 1 avatar (if it only finds one etc.) not being fully aware of the facts while compiling lists for eg. could get messy. Fact: If the event is not structured well to exclude NULL_KEYs they can be returned. -- &#039;&#039;&#039;[[User:EddyFragment Robonaught|Eddy]]&#039;&#039;&#039;  &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:EddyFragment_Robonaught|talk]]|[[Special:Contributions/EddyFragment_Robonaught|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 21:21, 8 August 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Agent&#039;s sit target no longer shows up? ==&lt;br /&gt;
This statement:&lt;br /&gt;
&amp;quot;If the agent is sitting on an object, the root prim of the sat upon object becomes a second sensor target for the agent (but not if the avatar is outside the sensor arc, see SVC-5145[c]).&amp;quot;&lt;br /&gt;
no longer seems to be true - if you search for an agent, you only get the agent, and not the object it&#039;s sitting on. (No clue when this changed, I only tried it for the first time tonight).&lt;br /&gt;
[[User:Redwood Rhiadra|Redwood Rhiadra]] 01:22, 2 October 2010 (UTC)&lt;br /&gt;
: Hi, this feature is definitely confusing, that is what {{Jira|SVC-5145}} is, a request to make the behavior sensible and consistent. I will repeat the tests this weekend and see if it is broken in the same old way or if there are new ways too. --[[User:Cerise Sorbet|Cerise Sorbet]] 03:30, 2 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
__________________________________&lt;br /&gt;
&lt;br /&gt;
== examples on this page are inadequate. == &lt;br /&gt;
&lt;br /&gt;
And no, I don&#039;t dare try to add any more, because Strife the Control Queen doesn&#039;t need examples for himself, so he just deletes them all.&lt;br /&gt;
&lt;br /&gt;
[[User:Chaz Longstaff|Chaz Longstaff]] 18:20, 19 September 2011 (PDT)&lt;br /&gt;
:The ad homimem attack is unnecessary. Taking a look at llListen which is another function that is paired with an event, I added an example script to showcase llSensor with the sensor event. Will that do? --[[User:Nexii Malthus|&amp;lt;span style=&amp;quot;color: #111; text-shadow:-1px -1px #ddd, 1px 1px #888;&amp;quot;&amp;gt;Nexii Malthus&amp;lt;/span&amp;gt;]] 19:45, 19 September 2011 (PDT)&lt;br /&gt;
&lt;br /&gt;
I don&#039;t recall deleting any content recently, let alone an example. I remember once in the last year(or two?) deleting an entirely duplicate example (had been double pasted into the article?) but nothing more recent. So I&#039;m at a bit of a loss for words.&lt;br /&gt;
&lt;br /&gt;
I honestly wish people would post more examples, there is even a category for articles in need of examples: [[:Category:LSL_Needs_Example]] and general improvement [[:Category:LSL FixMe]]. I generally leave writing examples to others, not because I don&#039;t find them useful, I often can&#039;t think of a simple useful example, my examples tend to bury the usage in a script that is better placed in the Script Library (which no one ever sees or uses). I don&#039;t spend much time here and less time in SL, so I&#039;m pretty cautious with my edits and unlikely to edit an example or script.&lt;br /&gt;
&lt;br /&gt;
So I&#039;m Currently working my way through the new functions and features from [[Release_Notes/Second_Life_RC_LeTigre/11#11.09.09.240509]] but I don&#039;t have a lot of time to devote to it. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 13:21, 20 September 2011 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Error with sensor page ==&lt;br /&gt;
&lt;br /&gt;
has anybody noticed that the sensor page shows up odd when not loged into the wiki?[[User:Tmzasz Luminos|Tmzasz Luminos]] 20:15, 14 February 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
:What browser are you using? -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 12:21, 15 February 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
:Never mind, it&#039;s definitely a wiki engine issue. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 12:31, 15 February 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
:{{Jira|WEB-4489}} -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 10:34, 17 February 2012 (PST)&lt;br /&gt;
&lt;br /&gt;
== AGENT vs AGENT_BY_LEGACY_NAME - No ambiguity if there&#039;s no name to filter by ==&lt;br /&gt;
&lt;br /&gt;
The docs say: &amp;quot;If name, id, and/or type are empty or 0, they are ignored.&amp;quot; In that case, the name is empty, it&#039;s ignored and not to be interpreted in any meaningful way. There is no possible ambiguity on how the name should be interpreted because there is no name to filter by. And please explain the removal of the text about how adding a name affects the result. It was a good example of how to use AGENT_BY_LEGACY_NAME to resolve the ambiguity. Maybe a fictitious name should be used instead of an existing one to prevent self-promotion. I&#039;d agree with that, but that name wasn&#039;t even touched. I don&#039;t understand the reversal. -- [[User:Sei Lisa|Sei Lisa]] 10:00, 22 October 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
: I think the example text rollback was an oversight. I shall put it back. I agree, we should choose someone else, for kicks we could make it the last person who edits the page. Thoughts?&lt;br /&gt;
: I&#039;m going to split hairs a bit, the ambiguity does not go away, it just becomes meaningless. However when you edit the code to add a name, that is when the ambiguity matters and where AGENT bite you in the butt. I&#039;d really would like to kill [[AGENT]] off to rid us of this problem. With AGENT we save in letters typed but we get burned by creating a lovely little &amp;quot;Gotcha&amp;quot;: For the new users they would see the three flags and expect [[AGENT]] to be the generic form that allows you to search by either and most likely to be the one that searches by display name. No [[AGENT]], no misunderstanding in the mind of the reader. Hopefully when they encounter [[AGENT]] it will be on the documentation. Regardless, I find using the longer name with the null case distasteful but something I think is worth inflicting on new users. Like using [[run_time_permissions]].&lt;br /&gt;
: Your gallery solution is the most practical of them all. I not happy with how gallery breaks things but recreating gallery with templates is something I&#039;m going to avoid.  -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 21:39, 22 October 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
:: On names: using either a famous Linden name or a fictitious name feels better than a variable one. Governor Linden is one I&#039;m considering, and John Doe is another. I&#039;d lean towards the latter.&lt;br /&gt;
:: On the gallery: What I miss with the gallery is a reference in the text that says where to find it (&amp;quot;look at the bottom of this page...&amp;quot;)&lt;br /&gt;
:: On the edit: Given that I have yet to see one use case for AGENT_BY_USERNAME, I would aim for readability, and AGENT is preferable not because it&#039;s shorter, but because it doesn&#039;t confuse with something that is very rarely if at all there (the username or the legacy name). Once you put a name, if that ever happens, which I doubt, especially for a new user, you can change it to the correct type of name. And of course, you can not &amp;quot;kill&amp;quot; AGENT, because AGENT_BY_USERNAME does simply not work at all with llDetectedType, and AGENT_BY_LEGACY_NAME is very clearly a misname for that case. The flags are shared with llDetectedType and there&#039;s even no indication in that page that AGENT_BY_USERNAME won&#039;t work at all with it. That is a separate issue, but the logic that leads to preferring AGENT there also applies to prefer AGENT when no name is specified in llSensor. -- [[User:Sei Lisa|Sei Lisa]] 01:16, 23 October 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
:: &amp;lt;rant&amp;gt; I consider the introduction of AGENT_BY_LEGACY_NAME a mistake. The whole display name system has been a hack on top of the existing, now &amp;quot;legacy&amp;quot; name system, including the LSL additions. The same logic that led to the introduction of AGENT_BY_LEGACY_NAME should for example have led to deprecating llKey2Name and introducing llGetLegacyName as a synonym, yet that didn&#039;t happen. People are expected to know that llKey2Name returns a legacy name and not a display name or username. It shouldn&#039;t be any different with AGENT; just adding AGENT_BY_USERNAME to provide access to the new functionality should have been enough. The mere presence of AGENT_BY_LEGACY_NAME has proven to introduce more confusion than the one caused by forgetting to change it to AGENT_BY_USERNAME when using a username in the name (again, if that ever happens). The problem is that it references a name where it isn&#039;t applicable, leaving the reader of the code wondering: &amp;quot;Name? What name?&amp;quot; It&#039;s akin to giving instructions to someone having a step that is not applicable at all. Imagine telling someone &amp;quot;Go straight through this street; turn right when you see a sign that says &#039;X&#039;, and turn left when you see a sign that says &#039;Y&#039;&amp;quot; but there is only an &#039;Y&#039; sign and all that is needed to reach the destination is to turn left when reaching it. The instructions are logically impeccable, and anyone following them literally will reach the destination, but the receiver will wonder where is that &#039;X&#039; sign. That&#039;s what I feel every time I see a llSensor call using &amp;quot;&amp;quot; as name and AGENT_BY_LEGACY_NAME as constant. If one is to be killed, it&#039;s AGENT_BY_LEGACY_NAME, not AGENT. &amp;lt;/rant&amp;gt;&lt;br /&gt;
:: There, I said it. To elaborate on shortness, being shorter is not at all a reason to prefer it. I really wish that it at least had a namespace prefix like SENSOR_ or OBJECT_TYPE_ or the like, to reduce the chance of name collisions and clarify the scope of its applicability. It doesn&#039;t, sadly. -- [[User:Sei Lisa|Sei Lisa]] 02:00, 23 October 2013 (PDT)&lt;br /&gt;
:::Good point about directions.&lt;br /&gt;
:::llDetectedType: I&#039;ll poke the template so it does not show the AGENT_* constants there, only AGENT. I really wish they had prefixed them, also the texture animation constants, who would guess [[PING_PONG]] was a texture animation constant without looking it up? LSL was built before it was designed. Personally it all have been better if LSL was object oriented, you wouldn&#039;t have had so many silly lookup functions.&lt;br /&gt;
:::Governor Linden was actually who I was thinking of, that or Philip Linden. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 10:59, 23 October 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
::::I have to agree with Sei on this one. It is clearly silly to say you are searching by a name when that is exactly what you are not doing. Like it or not, AGENT exists, and we should demonstrate it. I will continue to use AGENT where appropriate for as long as it compiles. I also belong to the school that feels that the whole display name idea was a stupid mistake. [[User:Omei Qunhua|Omei Qunhua]] 12:52, 23 October 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
:::: @ Strife:&lt;br /&gt;
:::: On names: While I still would lean towards John Doe, I have no strong opinion; Governor Linden is fine with me. Philip Linden could potentially have political issues in future, I hope not.&lt;br /&gt;
:::: On prefixes: Sad thing is they made the same mistake recently when they introduced HORIZONTAL and VERTICAL for pathfinding. Talk about namespace pollution. Oh, well.&lt;br /&gt;
:::: On the change: would you consider re-applying my changes then?&lt;br /&gt;
:::: @ Omei: Thanks for the support :) I wouldn&#039;t go as far as calling it a stupid mistake, but it&#039;s a hack no matter how good or bad idea it is. -- [[User:Sei Lisa|Sei Lisa]] 13:20, 23 October 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
:::: Thanks for the change, very appreciated! -- [[User:Sei Lisa|Sei Lisa]] 10:05, 24 October 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
::::: You are welcome. I would be ok with causing a little political uproar. Streisand effect, would be good for the wiki. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 22:01, 25 October 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Diameter or Radius? ==&lt;br /&gt;
&lt;br /&gt;
Why does this functions wiki page not explicitly state weather the float RANGE, is a Diameter, or a Radius?&lt;br /&gt;
&lt;br /&gt;
Just calling it a Range, seems kinda ambiguous. Sure many of us can just assume, or experiment to be sure. But it seems like info that belongs on the upper most definition of the function. &lt;br /&gt;
&lt;br /&gt;
Maybe I&#039;m just missing it due to sleep deprivation. [[User:ThumpieBunnyEve Hax|ThumpieBunnyEve Hax]] ([[User talk:ThumpieBunnyEve Hax|talk]]) 15:23, 18 March 2015 (PDT)&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Range&amp;quot; means distance from the prim&#039;s or the wearer&#039;s center. That forms a sphere around said center, with the range&#039;s radius, within which everything is &amp;quot;in range&amp;quot; and everything outside is &amp;quot;out of range&amp;quot;. Therefore it is the radius. --[[User:Pedro Oval|Pedro Oval]] ([[User talk:Pedro Oval|talk]]) 04:44, 19 March 2015 (PDT)&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Talk:Key_Compression&amp;diff=1195477</id>
		<title>Talk:Key Compression</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Talk:Key_Compression&amp;diff=1195477"/>
		<updated>2015-02-06T00:04:11Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: Nitpick and sign&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Recommending the following for base64 example for compatibility:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;string keyToBase64(string s) {&lt;br /&gt;
   s = llDumpList2String(llParseString2List(s, [&amp;quot;-&amp;quot;], []), &amp;quot;&amp;quot;);&lt;br /&gt;
   return&lt;br /&gt;
      llGetSubString(llIntegerToBase64((integer)(&amp;quot;0x&amp;quot;+llGetSubString(s,0,5))&amp;lt;&amp;lt;8),0,3) +&lt;br /&gt;
      llGetSubString(llIntegerToBase64((integer)(&amp;quot;0x&amp;quot;+llGetSubString(s,6,11))&amp;lt;&amp;lt;8),0,3) +&lt;br /&gt;
      llGetSubString(llIntegerToBase64((integer)(&amp;quot;0x&amp;quot;+llGetSubString(s,12,17))&amp;lt;&amp;lt;8),0,3) +&lt;br /&gt;
      llGetSubString(llIntegerToBase64((integer)(&amp;quot;0x&amp;quot;+llGetSubString(s,18,23))&amp;lt;&amp;lt;8),0,3) +&lt;br /&gt;
      llGetSubString(llIntegerToBase64((integer)(&amp;quot;0x&amp;quot;+llGetSubString(s,24,29))&amp;lt;&amp;lt;8),0,3) +&lt;br /&gt;
      llGetSubString(llIntegerToBase64((integer)(&amp;quot;0x&amp;quot;+llGetSubString(s,30,31))&amp;lt;&amp;lt;24),0,1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string integer2hex(integer in) {&lt;br /&gt;
   string s = &amp;quot;0123456789abcdef&amp;quot;;&lt;br /&gt;
   string ret = &amp;quot;&amp;quot;;&lt;br /&gt;
   integer i;&lt;br /&gt;
   in = in &amp;gt;&amp;gt; 8;&lt;br /&gt;
   for (i = 0; i &amp;lt; 6; i++) {&lt;br /&gt;
      ret = llGetSubString(s, in &amp;amp; 0xF, in &amp;amp; 0xF) + ret;&lt;br /&gt;
      in = in &amp;gt;&amp;gt; 4;&lt;br /&gt;
   }&lt;br /&gt;
   return ret;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string pad_dash(string s) {&lt;br /&gt;
   return&lt;br /&gt;
      llGetSubString(s, 0, 7) + &amp;quot;-&amp;quot; +&lt;br /&gt;
      llGetSubString(s, 8,11) + &amp;quot;-&amp;quot; +&lt;br /&gt;
      llGetSubString(s,12,15) + &amp;quot;-&amp;quot; +&lt;br /&gt;
      llGetSubString(s,16,19) + &amp;quot;-&amp;quot; +&lt;br /&gt;
      llGetSubString(s,20,31);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
key base64ToKey(string s) {&lt;br /&gt;
   return (key) pad_dash(&lt;br /&gt;
      integer2hex(llBase64ToInteger(llGetSubString(s,0,3))) +&lt;br /&gt;
      integer2hex(llBase64ToInteger(llGetSubString(s,4,7))) +&lt;br /&gt;
      integer2hex(llBase64ToInteger(llGetSubString(s,8,11))) +&lt;br /&gt;
      integer2hex(llBase64ToInteger(llGetSubString(s,12,15))) +&lt;br /&gt;
      integer2hex(llBase64ToInteger(llGetSubString(s,16,19))) +&lt;br /&gt;
      integer2hex(llBase64ToInteger(llGetSubString(s,20,21)+&amp;quot;AA&amp;quot;)));&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Base 32768 optimized for size in Mono ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Copyright (C) 2009 Adam Wozniak and Doran Zemlja&lt;br /&gt;
// Copyright (C) 2015 Pedro Oval&lt;br /&gt;
// Released into the public domain.&lt;br /&gt;
// Free for anyone to use for any purpose they like.&lt;br /&gt;
//&lt;br /&gt;
// INTERNALLY, strings are represented as UTF-16, and internal memory&lt;br /&gt;
// is what we actually care about&lt;br /&gt;
//&lt;br /&gt;
// going for maximum compression, we should be able to get a 128 bit key&lt;br /&gt;
// down to 8 x 16 bit characters&lt;br /&gt;
//&lt;br /&gt;
// we&#039;ll do this by encoding integers as UTF-8 URL escaped characters,&lt;br /&gt;
// and calling llUnescapeURL to convert them to strings.&lt;br /&gt;
//&lt;br /&gt;
// unfortunately, UTF-16 has some unallowed codepoints.  In particular,&lt;br /&gt;
// llEscapeURL/llUnescapeURL fails on the following code points:&lt;br /&gt;
//&lt;br /&gt;
// 0000, D800-DFFF, FDD0-FDEF, FFFE, FFFF&lt;br /&gt;
//&lt;br /&gt;
// Let&#039;s just make our lives easy and go with 15 bits per character.&lt;br /&gt;
// We&#039;ll encode 0000-7FFF as 0100-8100 to avoid null characters and leave&lt;br /&gt;
// all ASCII characters available as serialisation seperators.&lt;br /&gt;
// Also, let&#039;s go easy and just save up the 8 MSB as a final character at&lt;br /&gt;
// the end.&lt;br /&gt;
//&lt;br /&gt;
// this gives us a quick and easy 9 character key&lt;br /&gt;
&lt;br /&gt;
// MOD: To make life even easier, use the range 0x800-0x87FF as they all&lt;br /&gt;
// start with the same UTF-8 range and there are no bits to test.&lt;br /&gt;
// (range is %E0-%EF)&lt;br /&gt;
&lt;br /&gt;
string bhex(integer in)&lt;br /&gt;
{&lt;br /&gt;
    return llGetSubString(&amp;quot;0123456789abcdef&amp;quot;, (in&amp;gt;&amp;gt;4) &amp;amp; 0xF, (in&amp;gt;&amp;gt;4) &amp;amp; 0xF)&lt;br /&gt;
         + llGetSubString(&amp;quot;0123456789abcdef&amp;quot;, in &amp;amp; 0xF, in &amp;amp; 0xF);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer utf2i(string c)&lt;br /&gt;
{&lt;br /&gt;
    integer ret = (integer)(&amp;quot;0x&amp;quot; + (string)llParseString2List(llEscapeURL(c), (list)&amp;quot;%&amp;quot;, []));&lt;br /&gt;
    return ((ret &amp;amp; 0x0F0000) &amp;gt;&amp;gt; 4) + ((ret &amp;amp; 0x3F00) &amp;gt;&amp;gt; 2) + (ret &amp;amp; 0x3F) + (integer)-0x800;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string i2url(integer i)&lt;br /&gt;
{&lt;br /&gt;
    i += 0x800;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;%&amp;quot; + bhex(0xE0 | (i &amp;gt;&amp;gt; 12))&lt;br /&gt;
         + &amp;quot;%&amp;quot; + bhex(0x80 | ((i &amp;gt;&amp;gt; 6) &amp;amp; 0x3F))&lt;br /&gt;
         + &amp;quot;%&amp;quot; + bhex(0x80 | (i &amp;amp; 0x3F))&lt;br /&gt;
         ;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string compress_key(string k)&lt;br /&gt;
{&lt;br /&gt;
    k = (string)llParseString2List(k, (list)&amp;quot;-&amp;quot;, []);&lt;br /&gt;
    string ret;&lt;br /&gt;
    integer i = (integer)-9;&lt;br /&gt;
    integer msbs;&lt;br /&gt;
    integer word;&lt;br /&gt;
&lt;br /&gt;
    while (++i)&lt;br /&gt;
    {&lt;br /&gt;
        word = (integer) (&amp;quot;0x&amp;quot; + llGetSubString(k, 4*i, ~(4*~i)));&lt;br /&gt;
        msbs = (msbs | (word &amp;amp; 0x8000)) &amp;gt;&amp;gt; 1;&lt;br /&gt;
        ret += i2url(word &amp;amp; 0x7FFF);&lt;br /&gt;
    }&lt;br /&gt;
    return llUnescapeURL(i2url(msbs) + ret);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string uncompress_key(string s)&lt;br /&gt;
{&lt;br /&gt;
    integer i = (integer)-9;&lt;br /&gt;
    integer value;&lt;br /&gt;
    integer msbs = utf2i(llGetSubString(s, value, value));&lt;br /&gt;
    string ret;&lt;br /&gt;
    while (++i)&lt;br /&gt;
    {&lt;br /&gt;
        value = utf2i(llGetSubString(s, i, i)) + ((msbs &amp;lt;&amp;lt; (-i)) &amp;amp; 0x8000);&lt;br /&gt;
        ret += bhex(value&amp;gt;&amp;gt;8) + bhex(value);&lt;br /&gt;
    }&lt;br /&gt;
    i = 24;&lt;br /&gt;
    while ((i += (integer)-4) &amp;amp; (integer)-8)&lt;br /&gt;
        ret = llInsertString(ret, i, &amp;quot;-&amp;quot;);&lt;br /&gt;
    return ret;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Example usage: generate a key, compress, uncompress, and check if it matches.&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        string k = llGenerateKey();&lt;br /&gt;
        string s = uncompress_key(compress_key(k));&lt;br /&gt;
        llOwnerSay((string)(k==s)+&amp;quot;\n&amp;quot;+k + &amp;quot;\n&amp;quot; + s);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
--[[User:Pedro Oval|Pedro Oval]] ([[User talk:Pedro Oval|talk]]) 16:04, 5 February 2015 (PST)&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Talk:Key_Compression&amp;diff=1195476</id>
		<title>Talk:Key Compression</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Talk:Key_Compression&amp;diff=1195476"/>
		<updated>2015-02-06T00:03:03Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: /* Base 32768 optimized for size in Mono */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Recommending the following for base64 example for compatibility:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;string keyToBase64(string s) {&lt;br /&gt;
   s = llDumpList2String(llParseString2List(s, [&amp;quot;-&amp;quot;], []), &amp;quot;&amp;quot;);&lt;br /&gt;
   return&lt;br /&gt;
      llGetSubString(llIntegerToBase64((integer)(&amp;quot;0x&amp;quot;+llGetSubString(s,0,5))&amp;lt;&amp;lt;8),0,3) +&lt;br /&gt;
      llGetSubString(llIntegerToBase64((integer)(&amp;quot;0x&amp;quot;+llGetSubString(s,6,11))&amp;lt;&amp;lt;8),0,3) +&lt;br /&gt;
      llGetSubString(llIntegerToBase64((integer)(&amp;quot;0x&amp;quot;+llGetSubString(s,12,17))&amp;lt;&amp;lt;8),0,3) +&lt;br /&gt;
      llGetSubString(llIntegerToBase64((integer)(&amp;quot;0x&amp;quot;+llGetSubString(s,18,23))&amp;lt;&amp;lt;8),0,3) +&lt;br /&gt;
      llGetSubString(llIntegerToBase64((integer)(&amp;quot;0x&amp;quot;+llGetSubString(s,24,29))&amp;lt;&amp;lt;8),0,3) +&lt;br /&gt;
      llGetSubString(llIntegerToBase64((integer)(&amp;quot;0x&amp;quot;+llGetSubString(s,30,31))&amp;lt;&amp;lt;24),0,1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string integer2hex(integer in) {&lt;br /&gt;
   string s = &amp;quot;0123456789abcdef&amp;quot;;&lt;br /&gt;
   string ret = &amp;quot;&amp;quot;;&lt;br /&gt;
   integer i;&lt;br /&gt;
   in = in &amp;gt;&amp;gt; 8;&lt;br /&gt;
   for (i = 0; i &amp;lt; 6; i++) {&lt;br /&gt;
      ret = llGetSubString(s, in &amp;amp; 0xF, in &amp;amp; 0xF) + ret;&lt;br /&gt;
      in = in &amp;gt;&amp;gt; 4;&lt;br /&gt;
   }&lt;br /&gt;
   return ret;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string pad_dash(string s) {&lt;br /&gt;
   return&lt;br /&gt;
      llGetSubString(s, 0, 7) + &amp;quot;-&amp;quot; +&lt;br /&gt;
      llGetSubString(s, 8,11) + &amp;quot;-&amp;quot; +&lt;br /&gt;
      llGetSubString(s,12,15) + &amp;quot;-&amp;quot; +&lt;br /&gt;
      llGetSubString(s,16,19) + &amp;quot;-&amp;quot; +&lt;br /&gt;
      llGetSubString(s,20,31);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
key base64ToKey(string s) {&lt;br /&gt;
   return (key) pad_dash(&lt;br /&gt;
      integer2hex(llBase64ToInteger(llGetSubString(s,0,3))) +&lt;br /&gt;
      integer2hex(llBase64ToInteger(llGetSubString(s,4,7))) +&lt;br /&gt;
      integer2hex(llBase64ToInteger(llGetSubString(s,8,11))) +&lt;br /&gt;
      integer2hex(llBase64ToInteger(llGetSubString(s,12,15))) +&lt;br /&gt;
      integer2hex(llBase64ToInteger(llGetSubString(s,16,19))) +&lt;br /&gt;
      integer2hex(llBase64ToInteger(llGetSubString(s,20,21)+&amp;quot;AA&amp;quot;)));&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Base 32768 optimized for size in Mono ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Copyright (C) 2009 Adam Wozniak and Doran Zemlja&lt;br /&gt;
// Copyright (C) 2015 Pedro Oval&lt;br /&gt;
// Released into the public domain.&lt;br /&gt;
// Free for anyone to use for any purpose they like.&lt;br /&gt;
//&lt;br /&gt;
// INTERNALLY, strings are represented as UTF-16, and internal memory&lt;br /&gt;
// is what we actually care about&lt;br /&gt;
//&lt;br /&gt;
// going for maximum compression, we should be able to get a 128 bit key&lt;br /&gt;
// down to 8 x 16 bit characters&lt;br /&gt;
//&lt;br /&gt;
// we&#039;ll do this by encoding integers as UTF-8 URL escaped characters,&lt;br /&gt;
// and calling llUnescapeURL to convert them to strings.&lt;br /&gt;
//&lt;br /&gt;
// unfortunately, UTF-16 has some unallowed codepoints.  In particular,&lt;br /&gt;
// llEscapeURL/llUnescapeURL fails on the following code points:&lt;br /&gt;
//&lt;br /&gt;
// 0000, D800-DFFF, FDD0-FDEF, FFFE, FFFF&lt;br /&gt;
//&lt;br /&gt;
// Let&#039;s just make our lives easy and go with 15 bits per character.&lt;br /&gt;
// We&#039;ll encode 0000-7FFF as 0100-8100 to avoid null characters and leave&lt;br /&gt;
// all ASCII characters available as serialisation seperators.&lt;br /&gt;
// Also, let&#039;s go easy and just save up the 8 MSB as a final character at&lt;br /&gt;
// the end.&lt;br /&gt;
//&lt;br /&gt;
// this gives us a quick and easy 9 character key&lt;br /&gt;
&lt;br /&gt;
// MOD: To make life even easier, use the range 0x800-0x8800 as they all&lt;br /&gt;
// start with the same UTF-8 range and there are no bits to test.&lt;br /&gt;
// (range is %E0-%EF)&lt;br /&gt;
&lt;br /&gt;
string bhex(integer in)&lt;br /&gt;
{&lt;br /&gt;
    return llGetSubString(&amp;quot;0123456789abcdef&amp;quot;, (in&amp;gt;&amp;gt;4) &amp;amp; 0xF, (in&amp;gt;&amp;gt;4) &amp;amp; 0xF)&lt;br /&gt;
         + llGetSubString(&amp;quot;0123456789abcdef&amp;quot;, in &amp;amp; 0xF, in &amp;amp; 0xF);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer utf2i(string c)&lt;br /&gt;
{&lt;br /&gt;
    integer ret = (integer)(&amp;quot;0x&amp;quot; + (string)llParseString2List(llEscapeURL(c), (list)&amp;quot;%&amp;quot;, []));&lt;br /&gt;
    return ((ret &amp;amp; 0x0F0000) &amp;gt;&amp;gt; 4) + ((ret &amp;amp; 0x3F00) &amp;gt;&amp;gt; 2) + (ret &amp;amp; 0x3F) + (integer)-0x800;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string i2url(integer i)&lt;br /&gt;
{&lt;br /&gt;
    i += 0x800;&lt;br /&gt;
&lt;br /&gt;
    return &amp;quot;%&amp;quot; + bhex(0xE0 | (i &amp;gt;&amp;gt; 12))&lt;br /&gt;
         + &amp;quot;%&amp;quot; + bhex(0x80 | ((i &amp;gt;&amp;gt; 6) &amp;amp; 0x3F))&lt;br /&gt;
         + &amp;quot;%&amp;quot; + bhex(0x80 | (i &amp;amp; 0x3F))&lt;br /&gt;
         ;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string compress_key(string k)&lt;br /&gt;
{&lt;br /&gt;
    k = (string)llParseString2List(k, (list)&amp;quot;-&amp;quot;, []);&lt;br /&gt;
    string ret;&lt;br /&gt;
    integer i = (integer)-9;&lt;br /&gt;
    integer msbs;&lt;br /&gt;
    integer word;&lt;br /&gt;
&lt;br /&gt;
    while (++i)&lt;br /&gt;
    {&lt;br /&gt;
        word = (integer) (&amp;quot;0x&amp;quot; + llGetSubString(k, 4*i, ~(4*~i)));&lt;br /&gt;
        msbs = (msbs | (word &amp;amp; 0x8000)) &amp;gt;&amp;gt; 1;&lt;br /&gt;
        ret += i2url(word &amp;amp; 0x7FFF);&lt;br /&gt;
    }&lt;br /&gt;
    return llUnescapeURL(i2url(msbs) + ret);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string uncompress_key(string s)&lt;br /&gt;
{&lt;br /&gt;
    integer i = (integer)-9;&lt;br /&gt;
    integer value;&lt;br /&gt;
    integer msbs = utf2i(llGetSubString(s, value, value));&lt;br /&gt;
    string ret;&lt;br /&gt;
    while (++i)&lt;br /&gt;
    {&lt;br /&gt;
        value = utf2i(llGetSubString(s, i, i)) + ((msbs &amp;lt;&amp;lt; (-i)) &amp;amp; 0x8000);&lt;br /&gt;
        ret += bhex(value&amp;gt;&amp;gt;8) + bhex(value);&lt;br /&gt;
    }&lt;br /&gt;
    i = 24;&lt;br /&gt;
    while ((i += (integer)-4) &amp;amp; (integer)-8)&lt;br /&gt;
        ret = llInsertString(ret, i, &amp;quot;-&amp;quot;);&lt;br /&gt;
    return ret;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Example usage: generate a key, compress, uncompress, and check if it matches.&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        string k = llGenerateKey();&lt;br /&gt;
        string s = uncompress_key(compress_key(k));&lt;br /&gt;
        llOwnerSay((string)(k==s)+&amp;quot;\n&amp;quot;+k + &amp;quot;\n&amp;quot; + s);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Talk:LlListSort&amp;diff=1195472</id>
		<title>Talk:LlListSort</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Talk:LlListSort&amp;diff=1195472"/>
		<updated>2015-02-05T12:52:13Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: &amp;lt;cpp&amp;gt; to &amp;lt;source&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Bubble Sort? ==&lt;br /&gt;
&lt;br /&gt;
This script:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(llList2CSV(llListSort([3,2,3,5,3,1,1,4], 2, TRUE)));&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
outputs&lt;br /&gt;
&lt;br /&gt;
 1, 4, 3, 5, 3, 1, 3, 2&lt;br /&gt;
&lt;br /&gt;
both in LSO and in Mono. This means that the sort is not [http://en.wikipedia.org/wiki/Sorting_algorithm#Stability stable]. Since stability is a characteristic of Bubble Sort, it looks like the claim of using Bubble Sort is not correct. --[[User:Pedro Oval|Pedro Oval]] 20:01, 5 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
:Good point. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 21:26, 5 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
maybe... needs an extended example to see if LSL backwards ordering isn&#039;t the culprit&amp;lt;br/&amp;gt;-- &#039;&#039;&#039;[[User:Void_Singer|Void]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 22:19, 5 April 2014 (PDT)&lt;br /&gt;
:If it&#039;s in reverse order, it&#039;s not stable either. The reverse would be 3,1,3,5,3,2 but the actual result is 3,5,3,1,3,2 --[[User:Pedro Oval|Pedro Oval]] 12:39, 6 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
doh, you&#039;re right... comb sort perhaps? looking at the ordering exchange seems more likely than insertion&amp;lt;br/&amp;gt;-- &#039;&#039;&#039;[[User:Void_Singer|Void]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 17:20, 6 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
:Best option could be to pose this question on the scripting mail list, Kelly appears to prefer that channel for tech information dumps. The bubble sort presumption probably came from a function included with the viewer part of the source, but its comments describe list syntax and functions that never made it to LSL2. --[[User:ObviousAltIsObvious Resident|ObviousAltIsObvious Resident]] 17:30, 6 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
::I think it was a semantic problem, the existing list functions don&#039;t leave any room for embedded lists. When they couldn&#039;t get pass-by-reference to work properly (assumption), they likely killed embedded lists because it didn&#039;t fit well in 16KiB.&lt;br /&gt;
::&#039;&#039;&#039;Q:&#039;&#039;&#039; Why does the viewer source contain code that is obviously server LSL VM source code?  &lt;br /&gt;
::&#039;&#039;&#039;A:&#039;&#039;&#039; A bit of history, before the age of Mono, scripts were compiled by the client, and the viewer source included a copy of much of the server VM code. You have to remember that the viewer wasn&#039;t always open source, it&#039;s likely that the client and server code once existed in a single repository, that would be recompiled at the same time. When LL opensourced the viewer, they split the repository, but because of interdependence between the server and client code, some files were duplicated between the two repositories. LSL related files overtime diverged, largely driven by Mono&#039;s server side compilation. So while it may seem strange now that the viewer contains server source, it wasn&#039;t at the time the article was written.&lt;br /&gt;
::-- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 19:08, 6 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
It&#039;s probably not very polite to bring up this link, but it may shed some light on the reasons behind usage of Bubble Sort and the presumption that it was used in the server code: [https://github.com/openmetaversefoundation/simian/blob/544379ec7fc85fabfbeb01c89bc168e46bc83452/Simian.Scripting.LindenApi/Lists.cs#LC464]. It mentions what it calls &amp;quot;type specific feathered sorting&amp;quot;, which I assume it to mean the individual sorting of elements of each type. The code claims that &amp;quot;unoptimized bubble sort&amp;quot; is the only way to achieve it. I haven&#039;t given it much thought yet, but I wonder if comb sort, as mentioned by Void, would also preserve that ordering. --[[User:Pedro Oval|Pedro Oval]] 03:09, 8 April 2014 (PDT)&lt;br /&gt;
: I think that 3 passes index, sort, write could do this as well. Miranda&#039;s comment in {{Jira|SVC-2988}} suggests that there is some other kind of overhead in there. --[[User:ObviousAltIsObvious Resident|ObviousAltIsObvious Resident]] 05:31, 8 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
:I&#039;ve tried Quicksort and Comb Sort. My input list was [3,2,1,3,3,4,3,3,1,4,1,9,3,6] with stride 2. llListSort returns [1,3,1,4,1,9,3,3,3,2,3,4,3,6]. I could not reproduce this result with Comb sort, not even pre-inverting the array nor by pre-inverting, sorting descending and post-inverting it. I&#039;ve tried two variations and all possible &#039;&#039;shrink&#039;&#039; values for this length. I&#039;ve also tried with Quicksort with a decent amount of possible choices of pivot (first, central, last, median, and sorting the first, central and last elements, using several variations of &amp;lt; and &amp;lt;= for median and sorting), to no avail. --[[User:Pedro Oval|Pedro Oval]] 07:01, 8 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
::I wish I had more time to play with this. Going by what is typically found in LL code, my first guess would be &amp;quot;whatever the GNU library is using in std::sort&amp;quot;. It could very well be a wrapper around that. Adding to fun, there are 2 major C++ libraries in GNU land, each uses a different approach. --[[User:ObviousAltIsObvious Resident|ObviousAltIsObvious Resident]] 07:30, 8 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
:::Boost? P.S. I&#039;ve looked at opensim code. I have no problem with us documenting opensim functions etc. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 08:58, 8 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
::::Same difference, as Boost uses std::sort: [http://svn.boost.org/svn/boost/trunk/boost/range/algorithm/sort.hpp]. Digging a bit I have found this: [http://en.wikipedia.org/wiki/Introsort#Implementations Introsort#Implementations (Wikipedia)] which made it sound like any attempt at reproducing the results without GNU libstdc++ was going to be too painful to be worth it. Then I&#039;ve tried with the C++11 program below; it was sorted in a stable way, as the result is: &amp;quot;1,3, 1,4, 1,9, 3,2, 3,4, 3,3, 3,6, &amp;quot;. I&#039;m willing to make more experiments but I&#039;m out of ideas at the moment. Any suggestions? (P.S.: who chose the colors for the C++ highlighter? Yuck!) --[[User:Pedro Oval|Pedro Oval]] 09:30, 9 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
#include &amp;lt;algorithm&amp;gt;&lt;br /&gt;
#include &amp;lt;vector&amp;gt;&lt;br /&gt;
&lt;br /&gt;
struct Rec&lt;br /&gt;
{&lt;br /&gt;
    int key;&lt;br /&gt;
    int data;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
bool sortByKey(const Rec &amp;amp;lhs, const Rec &amp;amp;rhs) { return lhs.key &amp;lt; rhs.key; }&lt;br /&gt;
&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
    std::vector&amp;lt;Rec&amp;gt; v = {{3,2},{1,3},{3,4},{3,3},{1,4},{1,9},{3,6}};&lt;br /&gt;
    std::sort(v.begin(), v.end(), sortByKey);&lt;br /&gt;
    for (Rec &amp;amp;n : v)&lt;br /&gt;
        std::cout &amp;lt;&amp;lt; n.key &amp;lt;&amp;lt; &amp;quot;,&amp;quot; &amp;lt;&amp;lt; n.data &amp;lt;&amp;lt; &amp;quot;, &amp;quot;;&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:tried substituting partial_sort (I think that bypasses the insertion sort libstdc++ likes to use on small sets), almost the same as LSL but not close enough. 1,4, 1,3, 1,9, 3,3, 3,2, 3,4, 3,6,  --[[User:ObviousAltIsObvious Resident|ObviousAltIsObvious Resident]] 15:34, 9 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I don t know why you are using boost c++ library .&lt;br /&gt;
Probably the key of the answer is inside the implementation of sort in the mono library .&lt;br /&gt;
&lt;br /&gt;
I dont know which version mono is , and which algorithm it uses for sort .&lt;br /&gt;
Nevertheless , the documentation from microsoft on dotnet c# gives :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
from [ http://msdn.microsoft.com/en-us/library/b0zbh7b6(v=vs.110).aspx ]&lt;br /&gt;
&lt;br /&gt;
 This method uses the Array.Sort method, which applies the introspective sort as follows:&lt;br /&gt;
 * If the partition size is fewer than 16 elements, it uses an insertion sort algorithm.&lt;br /&gt;
 * If the number of partitions exceeds 2 * LogN, where N is the range of the input array, it uses a Heapsort algorithm.&lt;br /&gt;
 * Otherwise, it uses a Quicksort algorithm.&lt;br /&gt;
 This implementation performs an unstable sort; that is, if two elements are equal, their order might not be preserved. &lt;br /&gt;
 In contrast, a stable sort   preserves the order of elements that are equal.&lt;br /&gt;
 On average, this method is an O(n log n) operation, where n is Count; in the worst case it is an O(n ^ 2) operation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We should verify if the actual version of mono used by linden uses the same strategy as microsoft.&lt;br /&gt;
But , at first view , it seems coherent with the actual observations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other note : a bubble sort is O(n) if the list is already sorted . Some other algorithms too.&lt;br /&gt;
And some other algorithms , not.&lt;br /&gt;
But in LSL/mono , sortig an already sorted list don t make it faster &lt;br /&gt;
&lt;br /&gt;
[[User:Miranda Umino|Miranda Umino]] 20:55, 17 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
:The sort works the same under LSO, so I believe we can rule out a native .net library call as the source of this behavior. --[[User:ObviousAltIsObvious Resident|ObviousAltIsObvious Resident]] 00:29, 18 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
I&#039;m still researching, but I&#039;ll advance some information. I&#039;ve reproduced the results with this script, which implements a very simple sort algorithm that is not listed in Wikipedia:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
list Sort(list input, integer stride)&lt;br /&gt;
{&lt;br /&gt;
    integer i;&lt;br /&gt;
    integer j;&lt;br /&gt;
&lt;br /&gt;
    for (i = 0; i &amp;lt; llGetListLength(input) - stride; i += stride)&lt;br /&gt;
    {&lt;br /&gt;
        for (j = i + stride; j &amp;lt; llGetListLength(input); j += stride)&lt;br /&gt;
        {&lt;br /&gt;
            if (llList2Integer(input, i) &amp;gt; llList2Integer(input, j))&lt;br /&gt;
            {&lt;br /&gt;
                // Swap records i &amp;amp; j&lt;br /&gt;
                input = llListReplaceList(&lt;br /&gt;
                            llListReplaceList(input, llList2List(input, j, j+stride-1), i, i+stride-1),&lt;br /&gt;
                            llList2List(input, i, i+stride-1), j, j+stride-1);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    return input;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        list MyList = [3,2,1,3,3,4,3,3,1,4,1,9,3,6];&lt;br /&gt;
        string L1 = llList2CSV(llListSort(MyList, 2, TRUE));&lt;br /&gt;
        string L2 = llList2CSV(Sort(MyList, 2));&lt;br /&gt;
        llOwnerSay(&amp;quot;O: &amp;quot; + L1);&lt;br /&gt;
        llOwnerSay(&amp;quot;N: &amp;quot; + L2);&lt;br /&gt;
        if (L1 != L2) llOwnerSay(&amp;quot;Different&amp;quot;); else llOwnerSay(&amp;quot;Equal&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
// Output:&lt;br /&gt;
// [09:50:20] Sort: O: 1, 3, 1, 4, 1, 9, 3, 3, 3, 2, 3, 4, 3, 6&lt;br /&gt;
// [09:50:20] Sort: N: 1, 3, 1, 4, 1, 9, 3, 3, 3, 2, 3, 4, 3, 6&lt;br /&gt;
// [09:50:20] Sort: Equal&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I realized it was a candidate while trying to understand how bubble sort would preserve the ordering as claimed by the OpenSim code. I couldn&#039;t, so I looked into the code in more detail, and I realized that the sorting algorithm used was &#039;&#039;not&#039;&#039; bubble sort, but the one implemented in the above script. It&#039;s a naïve algorithm similar to selection sort, but less optimal: it goes through each element, and does a sweep over the rest of the elements to see if there&#039;s one less than it. If so, it swaps them (selection sort just takes note of the index position of the least element, and swaps them at the end of the inner loop instead of as it goes). At the end of each sweep, the element in question will have the least of the remaining elements in the list. It&#039;s still O(n²), and worse in performance than selection sort (since it does more swaps), but it does indeed guarantee preservation of the order of the types as claimed, assuming that comparison of two elements of different types does not cause a swap. It&#039;s also not stable, by its nature, and as proved by the results above. --[[User:Pedro Oval|Pedro Oval]] 10:09, 19 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Update:&#039;&#039;&#039; Selection Sort fails to reproduce the results, which is expected. However, the above algorithm matched the results every time I&#039;ve tried. I tested with this list generation code in place of the constant:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
        list MyList;&lt;br /&gt;
        while (llGetListLength(MyList) &amp;lt; 500)&lt;br /&gt;
        {&lt;br /&gt;
            MyList = MyList + (integer)llFrand(12) + llGetListLength(MyList);&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
It seems we have a winner. --[[User:Pedro Oval|Pedro Oval]] 10:51, 19 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Update 2:&#039;&#039;&#039; It gets better. Type feathering is NOT respected in case of a descending sort. OpenSim gives different results to SL in that case. It looks like type feathering is not a feature, but a side effect of the algorithm used. I&#039;ve reproduced the results by always swapping when the types are different. The results I got are consistent with this: the comparison function returns TRUE if A and B are of the same type and A is greater than B, and FALSE otherwise, and the swap is done if (the comparison function returns TRUE) &#039;&#039;&#039;xor&#039;&#039;&#039; (ascending!=1), causing it to &#039;&#039;always&#039;&#039; swap elements of different types for descending sort, thus destroying the feathering. OpenSim respects the feathering for descending order. --[[User:Pedro Oval|Pedro Oval]] 14:38, 19 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
One sure thing : llListSort is not O(N*N) . LLstsort is O(N * Log2(N) )&lt;br /&gt;
&lt;br /&gt;
Here some results of your algorithm ( 2nd column = number of pairs ; 3rd column time in frames per iteration)&lt;br /&gt;
 &lt;br /&gt;
 BubbleSort&lt;br /&gt;
 NumberTest       N size  Average Time in Frames  &lt;br /&gt;
 Test #1 with       2    0.020000&lt;br /&gt;
 Test #2 with       3    0.050000&lt;br /&gt;
 Test #3 with       4    0.090000&lt;br /&gt;
 Test #4 with       6    0.200000&lt;br /&gt;
 Test #5 with       8    0.200000&lt;br /&gt;
 Test #6 with      12    0.650000&lt;br /&gt;
 Test #7 with      16    0.970000&lt;br /&gt;
 Test #8 with      24    1.850000&lt;br /&gt;
 Test #9 with      32    2.300000&lt;br /&gt;
 Test #10 with     48    5.590000&lt;br /&gt;
 Test #11 with     64    7.540000&lt;br /&gt;
 Test #12 with     96    18.270000&lt;br /&gt;
 Test #13 with    128    28.950000&lt;br /&gt;
 Test #14 with    160    53.440000&lt;br /&gt;
 Test #15 with    192    71.920000&lt;br /&gt;
 Test #16 with    224    90.050000&lt;br /&gt;
 Test #17 with    256    112.140000&lt;br /&gt;
&lt;br /&gt;
Time ( 2*128 ) = (2*2)  * Time(128) =&amp;gt; ALgorithm is O(N*N)&lt;br /&gt;
&lt;br /&gt;
And with LListSort&lt;br /&gt;
 LListSort	&lt;br /&gt;
 Test #1 with       2    0.040000   &lt;br /&gt;
 Test #2 with       3    0.070000&lt;br /&gt;
 Test #3 with       4    0.040000&lt;br /&gt;
 Test #4 with       6    0.050000&lt;br /&gt;
 Test #5 with       8    0.070000&lt;br /&gt;
 Test #6 with      12    0.150000&lt;br /&gt;
 Test #7 with      16    0.080000&lt;br /&gt;
 Test #8 with      24    0.210000&lt;br /&gt;
 Test #9 with      32    0.320000&lt;br /&gt;
 Test #10 with     48    0.340000&lt;br /&gt;
 Test #11 with     64    0.430000&lt;br /&gt;
 Test #12 with     96    0.280000&lt;br /&gt;
 Test #13 with    128    0.670000&lt;br /&gt;
 Test #14 with    160    0.650000&lt;br /&gt;
 Test #15 with    192    0.760000&lt;br /&gt;
 Test #16 with    224    0.660000&lt;br /&gt;
 Test #17 with    256    0.840000&lt;br /&gt;
&lt;br /&gt;
Time ( 2*128 ) = 2*log(2) * Time(128) =&amp;gt; ALgorithm is O(N*LogN)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
list Sort(list input, integer stride)&lt;br /&gt;
{&lt;br /&gt;
    integer i;&lt;br /&gt;
    integer j;&lt;br /&gt;
 &lt;br /&gt;
    for (i = 0; i &amp;lt; llGetListLength(input) - stride; i += stride)&lt;br /&gt;
    {&lt;br /&gt;
        for (j = i + stride; j &amp;lt; llGetListLength(input); j += stride)&lt;br /&gt;
        {&lt;br /&gt;
            if (llList2Integer(input, i) &amp;gt; llList2Integer(input, j))&lt;br /&gt;
            {&lt;br /&gt;
                // Swap records i &amp;amp; j&lt;br /&gt;
                input = llListReplaceList(&lt;br /&gt;
                            llListReplaceList(input, llList2List(input, j, j+stride-1), i, i+stride-1),&lt;br /&gt;
                            llList2List(input, i, i+stride-1), j, j+stride-1);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    return input;&lt;br /&gt;
}&lt;br /&gt;
default {&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        list tests = [&lt;br /&gt;
            // Ascending lists&lt;br /&gt;
            2, TRUE,&lt;br /&gt;
            3, TRUE,&lt;br /&gt;
            4, TRUE,&lt;br /&gt;
            6, TRUE,&lt;br /&gt;
            8, TRUE, &lt;br /&gt;
            12, TRUE,&lt;br /&gt;
            16, TRUE,&lt;br /&gt;
            24, TRUE,&lt;br /&gt;
            32, TRUE,&lt;br /&gt;
            48, TRUE,&lt;br /&gt;
            64, TRUE,&lt;br /&gt;
            96, TRUE,&lt;br /&gt;
            128, TRUE,&lt;br /&gt;
            160, TRUE,&lt;br /&gt;
            192, TRUE,&lt;br /&gt;
            224, TRUE,&lt;br /&gt;
            256, TRUE&lt;br /&gt;
/*            320, TRUE,&lt;br /&gt;
            384, TRUE,&lt;br /&gt;
            448, TRUE,&lt;br /&gt;
            512, TRUE &lt;br /&gt;
            */&lt;br /&gt;
&lt;br /&gt;
        ];&lt;br /&gt;
        integer repetitions = 100;&lt;br /&gt;
        integer test = 0; integer testsLength = tests != [];&lt;br /&gt;
         &lt;br /&gt;
        integer listSize; integer ascending; integer i; list t;&lt;br /&gt;
        float f; string s; list l = [];&lt;br /&gt;
        float nFrameStart;&lt;br /&gt;
        float nFrameEnd;&lt;br /&gt;
        float overhead;&lt;br /&gt;
        llOwnerSay(&amp;quot;Starting tests…&amp;quot;);&lt;br /&gt;
        for (; test &amp;lt; testsLength; test += 2) {&lt;br /&gt;
            listSize = llList2Integer(tests, test);&lt;br /&gt;
            ascending = llList2Integer(tests, test + 1);&lt;br /&gt;
             &lt;br /&gt;
            if (ascending) {&lt;br /&gt;
                i = 0;&lt;br /&gt;
                for (; i &amp;lt; listSize; ++i) &lt;br /&gt;
                    l +=  [(integer)llFrand(3),llFrand(10000)] ;&lt;br /&gt;
            } else {&lt;br /&gt;
                i = listSize;&lt;br /&gt;
                while ((--i) &amp;gt;= 0) &lt;br /&gt;
                    l +=  (integer)llFrand(10000);&lt;br /&gt;
            }&lt;br /&gt;
             &lt;br /&gt;
            i = 0;&lt;br /&gt;
            nFrameStart = (float)llGetEnv(&amp;quot;frame_number&amp;quot;);&lt;br /&gt;
            for (; i &amp;lt; repetitions; ++i) &lt;br /&gt;
                t = [];&lt;br /&gt;
            nFrameEnd = (float)llGetEnv(&amp;quot;frame_number&amp;quot;);&lt;br /&gt;
            overhead = nFrameEnd - nFrameStart;&lt;br /&gt;
            i = 0;&lt;br /&gt;
            nFrameStart = (float)llGetEnv(&amp;quot;frame_number&amp;quot;);&lt;br /&gt;
            for (; i &amp;lt; repetitions; ++i) &lt;br /&gt;
               // t = llListSort(l, 2, ascending);&lt;br /&gt;
               t = Sort(l,2);&lt;br /&gt;
            nFrameEnd = (float)llGetEnv(&amp;quot;frame_number&amp;quot;);      &lt;br /&gt;
            f =  nFrameEnd - nFrameStart - overhead;&lt;br /&gt;
            t = l = [];&lt;br /&gt;
            &lt;br /&gt;
            f /= (float)repetitions;&lt;br /&gt;
            s = &amp;quot;\tTest #&amp;quot; + (string)((test / 2) + 1) + &amp;quot; with\t&amp;quot; + (string)listSize + &amp;quot;\t&amp;quot; + (string)( f ); &lt;br /&gt;
           &lt;br /&gt;
            llOwnerSay(s);&lt;br /&gt;
        }&lt;br /&gt;
        llOwnerSay(&amp;quot;Tests complete.&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
--[[User:Miranda Umino|Miranda Umino]] 21:41, 19 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:It&#039;s definitively quadratic, i.e. O(n²). http://inky.ws/g/2zz --[[User:Pedro Oval|Pedro Oval]] 19:39, 5 May 2014 (PDT)&lt;br /&gt;
:&#039;&#039;&#039;Update:&#039;&#039;&#039; Added benchmarking script to the linked gallery. --[[User:Pedro Oval|Pedro Oval]] 06:15, 6 May 2014 (PDT)&lt;br /&gt;
:&#039;&#039;&#039;Update 2:&#039;&#039;&#039; I tried the same benchmarking script listed in Inky under LSO and the strangest thing happened. I changed the list addition line to use the &amp;lt;code&amp;gt;(MyList = []) + MyList&amp;lt;/code&amp;gt; trick, which allowed for an extra batch of 50. Here are the results I got:&lt;br /&gt;
:{| {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
!N !! Time&lt;br /&gt;
|-&lt;br /&gt;
|50 || 3.333132&lt;br /&gt;
|-&lt;br /&gt;
|100 || 6.786429&lt;br /&gt;
|-&lt;br /&gt;
|150 || 13.334011&lt;br /&gt;
|-&lt;br /&gt;
|200 || 13.333488&lt;br /&gt;
|-&lt;br /&gt;
|250 || 13.333256&lt;br /&gt;
|-&lt;br /&gt;
|300 || 13.333005&lt;br /&gt;
|-&lt;br /&gt;
|350 || 13.332855&lt;br /&gt;
|-&lt;br /&gt;
|400 || 13.334793&lt;br /&gt;
|-&lt;br /&gt;
|450 || 13.334989&lt;br /&gt;
|-&lt;br /&gt;
|500 || 13.332029&lt;br /&gt;
|}&lt;br /&gt;
:Looks like under LSO the function is being throttled. --[[User:Pedro Oval|Pedro Oval]] 13:36, 6 May 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Update 3:&#039;&#039;&#039; It seems it&#039;s throttled under Mono as well, just not so much. I&#039;ve added to the [http://inky.ws/g/2zz gallery] a graphic with a benchmark over the first 200-300 values, going through them one at a time. The delay seems roughly linear on N up to about N=80. Then it gets constant (to almost 3 seconds, actually about 2.95 or 2.97, according to the data, meaning almost 10 ms per call) until the actual time the function takes overtakes the throttle. When does that happen, depends on what is being compared (I used integers and vectors because they have a noticeably different comparison time) and on the performance of the sim (green line was taken on a faster sim).&lt;br /&gt;
:The benchmarking script is the same, just setting Step=1 and MaxN=300. The vectors were constant, set to &amp;lt;1,2,3&amp;gt;. For the descending test, I just changed all TRUE to FALSE. The first run is up to N=200 only because I thought it was enough, but when I finished and graphed it, it wasn&#039;t clear enough from the results I got, so I raised it to 300.&lt;br /&gt;
:I conjecture that the spikes are GC kicking in and may depend on available memory. The sim I went to to take the sample with the green line was much emptier. --[[User:Pedro Oval|Pedro Oval]] 05:07, 19 May 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Merge Sort in LSL ==&lt;br /&gt;
&lt;br /&gt;
I&#039;ve written a Merge Sort that&#039;s nearly comparable to the llListSort provided by LSL. It supports strided lists (as in the example below), but cannot reverse the order as llListSort does. I ran this test a few times on it, and surprisingly, it&#039;s faster than llListSort. The code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;list elements = [8.627350, &amp;quot;a3c6cf64-8daf-b6ca-9851-8a49a597fafc&amp;quot;, 18.943806, &amp;quot;3e0a230a-16ef-f539-b070-0ef0a16b1835&amp;quot;, 6.843595, &amp;quot;aa3183b2-a5ad-abb3-98c2-c07517c049b5&amp;quot;, 5.199630, &amp;quot;513ec659-a280-5ea4-ab3c-5f3a5544820e&amp;quot;, 14.510715, &amp;quot;7f1f52bc-c63f-aef0-73c9-cd97f1bddccc&amp;quot;, 12.230530, &amp;quot;3c719f4f-072d-b35f-9fe6-ed157e06c487&amp;quot;, 3.188807, &amp;quot;a84db094-9630-79fc-eb02-74bcbd030190&amp;quot;, 1.648486, &amp;quot;e0a8af06-2c43-57df-9571-22c035424acc&amp;quot;, 8.481318, &amp;quot;891c3eba-3723-29c4-f1ea-032b6dad2b1b&amp;quot;, 17.444149, &amp;quot;e4b04775-8d68-0d4a-773f-19f02c112066&amp;quot;];&lt;br /&gt;
&lt;br /&gt;
list merge(list left, list right, integer stride)&lt;br /&gt;
{&lt;br /&gt;
    list result;&lt;br /&gt;
    &lt;br /&gt;
    while(llGetListLength(left) &amp;gt; 0 || llGetListLength(right) &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        if(llGetListLength(left) &amp;gt; 0 &amp;amp;&amp;amp; llGetListLength(right) &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            // Ensure we&#039;re comparing the same things...&lt;br /&gt;
            if(llGetListEntryType(left, 0) == llGetListEntryType(right, 0))&lt;br /&gt;
            {&lt;br /&gt;
                // Get values in a re-cast-able form&lt;br /&gt;
                integer type = llGetListEntryType(left, 0);&lt;br /&gt;
                string InitialLeftValue = llList2String(left, 0);&lt;br /&gt;
                string InitialRightValue = llList2String(right, 0);&lt;br /&gt;
                &lt;br /&gt;
                // Handle all type cases&lt;br /&gt;
                &lt;br /&gt;
                if(type == TYPE_INTEGER)&lt;br /&gt;
                {&lt;br /&gt;
                    integer leftValue = (integer)InitialLeftValue;&lt;br /&gt;
                    integer rightValue = (integer)InitialRightValue;&lt;br /&gt;
                    &lt;br /&gt;
                    if(leftValue &amp;lt;= rightValue)&lt;br /&gt;
                    {&lt;br /&gt;
                        result += llList2List(left, 0, 1);&lt;br /&gt;
                        left = llDeleteSubList(left, 0, stride - 1);&lt;br /&gt;
                    }&lt;br /&gt;
                    else&lt;br /&gt;
                    {&lt;br /&gt;
                        result += llList2List(right, 0, 1);&lt;br /&gt;
                        right = llDeleteSubList(right, 0, stride - 1);&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
                else if(type == TYPE_FLOAT)&lt;br /&gt;
                {&lt;br /&gt;
                    float leftValue = (float)InitialLeftValue;&lt;br /&gt;
                    float rightValue = (float)InitialRightValue;&lt;br /&gt;
                    &lt;br /&gt;
                    if(leftValue &amp;lt;= rightValue)&lt;br /&gt;
                    {&lt;br /&gt;
                        result += llList2List(left, 0, 1);&lt;br /&gt;
                        left = llDeleteSubList(left, 0, stride - 1);&lt;br /&gt;
                    }&lt;br /&gt;
                    else&lt;br /&gt;
                    {&lt;br /&gt;
                        result += llList2List(right, 0, 1);&lt;br /&gt;
                        right = llDeleteSubList(right, 0, stride - 1);&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
                else if(type == TYPE_VECTOR)&lt;br /&gt;
                {&lt;br /&gt;
                    float leftValue = llVecMag((vector)InitialLeftValue);&lt;br /&gt;
                    float rightValue = llVecMag((vector)InitialRightValue);&lt;br /&gt;
                    &lt;br /&gt;
                    if(leftValue &amp;lt;= rightValue)&lt;br /&gt;
                    {&lt;br /&gt;
                        result += llList2List(left, 0, 1);&lt;br /&gt;
                        left = llDeleteSubList(left, 0, stride - 1);&lt;br /&gt;
                    }&lt;br /&gt;
                    else&lt;br /&gt;
                    {&lt;br /&gt;
                        result += llList2List(right, 0, 1);&lt;br /&gt;
                        right = llDeleteSubList(right, 0, stride - 1);&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
                else if(type == TYPE_ROTATION)&lt;br /&gt;
                {&lt;br /&gt;
                    float leftValue = llRot2Angle((rotation)InitialLeftValue);&lt;br /&gt;
                    float rightValue = llRot2Angle((rotation)InitialRightValue);&lt;br /&gt;
                    &lt;br /&gt;
                    if(leftValue &amp;lt;= rightValue)&lt;br /&gt;
                    {&lt;br /&gt;
                        result += llList2List(left, 0, 1);&lt;br /&gt;
                        left = llDeleteSubList(left, 0, stride - 1);&lt;br /&gt;
                    }&lt;br /&gt;
                    else&lt;br /&gt;
                    {&lt;br /&gt;
                        result += llList2List(right, 0, 1);&lt;br /&gt;
                        right = llDeleteSubList(right, 0, stride - 1);&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else if(llGetListLength(left) &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            result += llList2List(left, 0, 1);&lt;br /&gt;
            left = llDeleteSubList(left, 0, stride - 1);&lt;br /&gt;
        }&lt;br /&gt;
        else if(llGetListLength(right) &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            result += llList2List(right, 0, 1);&lt;br /&gt;
            right = llDeleteSubList(right, 0, stride - 1);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    return result;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
list llListSortFast(list in, integer stride)&lt;br /&gt;
{&lt;br /&gt;
    if(llGetListLength(in) &amp;lt;= stride)&lt;br /&gt;
    {&lt;br /&gt;
        return in;&lt;br /&gt;
    }&lt;br /&gt;
    integer middle = (llGetListLength(in) / stride) / 2;&lt;br /&gt;
    &lt;br /&gt;
    list left = llList2List(in, 0, (middle) * stride - 1);&lt;br /&gt;
    list right = llList2List(in, middle * stride, -1);&lt;br /&gt;
    &lt;br /&gt;
    left = llListSortFast(left, stride);&lt;br /&gt;
    right = llListSortFast(right, stride);&lt;br /&gt;
    &lt;br /&gt;
    return merge(left, right, stride);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSay(0, &amp;quot;Input: \n Merge Sort:&amp;quot; + llList2CSV(elements));&lt;br /&gt;
        float time = llGetAndResetTime();&lt;br /&gt;
        llSay(0, &amp;quot;Sorted Result: \n&amp;quot; + llList2CSV(llListSortFast(elements, 2)));&lt;br /&gt;
        llSay(0, &amp;quot;Time Taken: &amp;quot; + (string)time);&lt;br /&gt;
        time = llGetAndResetTime();&lt;br /&gt;
        llSay(0, &amp;quot;Bubble Sort Result: \n&amp;quot; + llList2CSV(llListSort(elements, 2, TRUE)));&lt;br /&gt;
        llSay(0, &amp;quot;Time Taken: &amp;quot; + (string)time);&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Can others proofread and/or test this with other values and confirm that I am not producing false results?&lt;br /&gt;
&lt;br /&gt;
If does turn out to be more efficient, please feel free to use it in your own projects.&lt;br /&gt;
&lt;br /&gt;
::I&#039;m afraid your timing system is faulty. You&#039;re not reading the times at the right points in your code. I&#039;m afraid on an admitedly very quick test llListSort() wins by a long chalk. Never-the-less, bravo on getting your merge sort to work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
    touch_start(integer num)&lt;br /&gt;
    {&lt;br /&gt;
&lt;br /&gt;
        llSay(0, &amp;quot;Input: \n Merge Sort:&amp;quot; + llList2CSV(elements));&lt;br /&gt;
        llResetTime();&lt;br /&gt;
        list lx = ListSortFast(elements, 2);&lt;br /&gt;
        float time = llGetTime();&lt;br /&gt;
        llSay(0, &amp;quot;Time Taken MergeSort: &amp;quot; + (string)time);&lt;br /&gt;
        llSay(0, &amp;quot;Sorted Result: \n&amp;quot; + llList2CSV(lx));&lt;br /&gt;
        &lt;br /&gt;
        llSleep(1);&lt;br /&gt;
        llResetTime();&lt;br /&gt;
        lx = llListSort(elements, 2, TRUE);&lt;br /&gt;
        time = llGetTime();&lt;br /&gt;
        llSay(0, &amp;quot;Time Taken llListSort: &amp;quot; + (string)time); &lt;br /&gt;
        llSay(0, &amp;quot;Bubble Sort Result: \n&amp;quot; + llList2CSV(lx));&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
p.s. On a test of 5000 sorts of your data, the merge sort is 5.5 times slower than llListSort(). Sorry!&lt;br /&gt;
[[User:Omei Qunhua|Omei Qunhua]] 15:09, 22 May 2014 (PDT)&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Talk:Key_Compression&amp;diff=1195471</id>
		<title>Talk:Key Compression</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Talk:Key_Compression&amp;diff=1195471"/>
		<updated>2015-02-05T11:10:26Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: oops, how did that get there?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Recommending the following for base64 example for compatibility:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;string keyToBase64(string s) {&lt;br /&gt;
   s = llDumpList2String(llParseString2List(s, [&amp;quot;-&amp;quot;], []), &amp;quot;&amp;quot;);&lt;br /&gt;
   return&lt;br /&gt;
      llGetSubString(llIntegerToBase64((integer)(&amp;quot;0x&amp;quot;+llGetSubString(s,0,5))&amp;lt;&amp;lt;8),0,3) +&lt;br /&gt;
      llGetSubString(llIntegerToBase64((integer)(&amp;quot;0x&amp;quot;+llGetSubString(s,6,11))&amp;lt;&amp;lt;8),0,3) +&lt;br /&gt;
      llGetSubString(llIntegerToBase64((integer)(&amp;quot;0x&amp;quot;+llGetSubString(s,12,17))&amp;lt;&amp;lt;8),0,3) +&lt;br /&gt;
      llGetSubString(llIntegerToBase64((integer)(&amp;quot;0x&amp;quot;+llGetSubString(s,18,23))&amp;lt;&amp;lt;8),0,3) +&lt;br /&gt;
      llGetSubString(llIntegerToBase64((integer)(&amp;quot;0x&amp;quot;+llGetSubString(s,24,29))&amp;lt;&amp;lt;8),0,3) +&lt;br /&gt;
      llGetSubString(llIntegerToBase64((integer)(&amp;quot;0x&amp;quot;+llGetSubString(s,30,31))&amp;lt;&amp;lt;24),0,1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string integer2hex(integer in) {&lt;br /&gt;
   string s = &amp;quot;0123456789abcdef&amp;quot;;&lt;br /&gt;
   string ret = &amp;quot;&amp;quot;;&lt;br /&gt;
   integer i;&lt;br /&gt;
   in = in &amp;gt;&amp;gt; 8;&lt;br /&gt;
   for (i = 0; i &amp;lt; 6; i++) {&lt;br /&gt;
      ret = llGetSubString(s, in &amp;amp; 0xF, in &amp;amp; 0xF) + ret;&lt;br /&gt;
      in = in &amp;gt;&amp;gt; 4;&lt;br /&gt;
   }&lt;br /&gt;
   return ret;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string pad_dash(string s) {&lt;br /&gt;
   return&lt;br /&gt;
      llGetSubString(s, 0, 7) + &amp;quot;-&amp;quot; +&lt;br /&gt;
      llGetSubString(s, 8,11) + &amp;quot;-&amp;quot; +&lt;br /&gt;
      llGetSubString(s,12,15) + &amp;quot;-&amp;quot; +&lt;br /&gt;
      llGetSubString(s,16,19) + &amp;quot;-&amp;quot; +&lt;br /&gt;
      llGetSubString(s,20,31);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
key base64ToKey(string s) {&lt;br /&gt;
   return (key) pad_dash(&lt;br /&gt;
      integer2hex(llBase64ToInteger(llGetSubString(s,0,3))) +&lt;br /&gt;
      integer2hex(llBase64ToInteger(llGetSubString(s,4,7))) +&lt;br /&gt;
      integer2hex(llBase64ToInteger(llGetSubString(s,8,11))) +&lt;br /&gt;
      integer2hex(llBase64ToInteger(llGetSubString(s,12,15))) +&lt;br /&gt;
      integer2hex(llBase64ToInteger(llGetSubString(s,16,19))) +&lt;br /&gt;
      integer2hex(llBase64ToInteger(llGetSubString(s,20,21)+&amp;quot;AA&amp;quot;)));&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Talk:Key_Compression&amp;diff=1195470</id>
		<title>Talk:Key Compression</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Talk:Key_Compression&amp;diff=1195470"/>
		<updated>2015-02-05T11:09:47Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: &amp;lt;lsl&amp;gt; to &amp;lt;source&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Recommending the following for base64 example for compatibility:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;string keyToBase64(string s) {&lt;br /&gt;
   s = llDumpList2String(llParseString2List(s, [&amp;quot;-&amp;quot;], []), &amp;quot;&amp;quot;);&lt;br /&gt;
   return&lt;br /&gt;
      llGetSubString(llIntegerToBase64((integer)(&amp;quot;0x&amp;quot;+llGetSubString(s,0,5))&amp;lt;&amp;lt;8),0,3) +&lt;br /&gt;
      llGetSubString(llIntegerToBase64((integer)(&amp;quot;0x&amp;quot;+llGetSubString(s,6,11))&amp;lt;&amp;lt;8),0,3) +&lt;br /&gt;
      llGetSubString(llIntegerToBase64((integer)(&amp;quot;0x&amp;quot;+llGetSubString(s,12,17))&amp;lt;&amp;lt;8),0,3) +&lt;br /&gt;
      llGetSubString(llIntegerToBase64((integer)(&amp;quot;0x&amp;quot;+llGetSubString(s,18,23))&amp;lt;&amp;lt;8),0,3) +&lt;br /&gt;
      llGetSubString(llIntegerToBase64((integer)(&amp;quot;0x&amp;quot;+llGetSubString(s,24,29))&amp;lt;&amp;lt;8),0,3) +&lt;br /&gt;
      llGetSubString(llIntegerToBase64((integer)(&amp;quot;0x&amp;quot;+llGetSubString(s,30,31))&amp;lt;&amp;lt;24),0,1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string integer2hex(integer in) {&lt;br /&gt;
   string s = &amp;quot;0123456789abcdef&amp;quot;;&lt;br /&gt;
   string ret = &amp;quot;&amp;quot;;&lt;br /&gt;
   integer i;&lt;br /&gt;
   in = in &amp;gt;&amp;gt; 8;&lt;br /&gt;
   for (i = 0; i &amp;lt; 6; i++) {&lt;br /&gt;
      ret = llGetSubString(s, in &amp;amp; 0xF, in &amp;amp; 0xF) + ret;&lt;br /&gt;
      in = in &amp;gt;&amp;gt; 4;&lt;br /&gt;
   }&lt;br /&gt;
   return ret;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string pad_dash(string s) {&lt;br /&gt;
   return&lt;br /&gt;
      llGetSubString(s, 0, 7) + &amp;quot;-&amp;quot; +&lt;br /&gt;
      llGetSubString(s, 8,11) + &amp;quot;-&amp;quot; +&lt;br /&gt;
      llGetSubString(s,12,15) + &amp;quot;-&amp;quot; +&lt;br /&gt;
      llGetSubString(s,16,19) + &amp;quot;-&amp;quot; +&lt;br /&gt;
      llGetSubString(s,20,31);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
key base64ToKey(string s) {&lt;br /&gt;
   return (key) pad_dash(&lt;br /&gt;
      integer2hex(llBase64ToInteger(llGetSubString(s,0,3))) +&lt;br /&gt;
      integer2hex(llBase64ToInteger(llGetSubString(s,4,7))) +&lt;br /&gt;
      integer2hex(llBase64ToInteger(llGetSubString(s,8,11))) +&lt;br /&gt;
      integer2hex(llBase64ToInteger(llGetSubString(s,12,15))) +&lt;br /&gt;
      integer2hex(llBase64ToInteger(llGetSubString(s,16,19))) +&lt;br /&gt;
      integer2hex(llBase64ToInteger(llGetSubString(s,20,21)+&amp;quot;AA&amp;quot;)));&lt;br /&gt;
}&amp;lt;/source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Talk:LlListSort&amp;diff=1195469</id>
		<title>Talk:LlListSort</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Talk:LlListSort&amp;diff=1195469"/>
		<updated>2015-02-05T11:05:13Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: &amp;lt;lsl&amp;gt; to &amp;lt;source&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Bubble Sort? ==&lt;br /&gt;
&lt;br /&gt;
This script:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(llList2CSV(llListSort([3,2,3,5,3,1,1,4], 2, TRUE)));&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
outputs&lt;br /&gt;
&lt;br /&gt;
 1, 4, 3, 5, 3, 1, 3, 2&lt;br /&gt;
&lt;br /&gt;
both in LSO and in Mono. This means that the sort is not [http://en.wikipedia.org/wiki/Sorting_algorithm#Stability stable]. Since stability is a characteristic of Bubble Sort, it looks like the claim of using Bubble Sort is not correct. --[[User:Pedro Oval|Pedro Oval]] 20:01, 5 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
:Good point. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 21:26, 5 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
maybe... needs an extended example to see if LSL backwards ordering isn&#039;t the culprit&amp;lt;br/&amp;gt;-- &#039;&#039;&#039;[[User:Void_Singer|Void]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 22:19, 5 April 2014 (PDT)&lt;br /&gt;
:If it&#039;s in reverse order, it&#039;s not stable either. The reverse would be 3,1,3,5,3,2 but the actual result is 3,5,3,1,3,2 --[[User:Pedro Oval|Pedro Oval]] 12:39, 6 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
doh, you&#039;re right... comb sort perhaps? looking at the ordering exchange seems more likely than insertion&amp;lt;br/&amp;gt;-- &#039;&#039;&#039;[[User:Void_Singer|Void]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 17:20, 6 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
:Best option could be to pose this question on the scripting mail list, Kelly appears to prefer that channel for tech information dumps. The bubble sort presumption probably came from a function included with the viewer part of the source, but its comments describe list syntax and functions that never made it to LSL2. --[[User:ObviousAltIsObvious Resident|ObviousAltIsObvious Resident]] 17:30, 6 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
::I think it was a semantic problem, the existing list functions don&#039;t leave any room for embedded lists. When they couldn&#039;t get pass-by-reference to work properly (assumption), they likely killed embedded lists because it didn&#039;t fit well in 16KiB.&lt;br /&gt;
::&#039;&#039;&#039;Q:&#039;&#039;&#039; Why does the viewer source contain code that is obviously server LSL VM source code?  &lt;br /&gt;
::&#039;&#039;&#039;A:&#039;&#039;&#039; A bit of history, before the age of Mono, scripts were compiled by the client, and the viewer source included a copy of much of the server VM code. You have to remember that the viewer wasn&#039;t always open source, it&#039;s likely that the client and server code once existed in a single repository, that would be recompiled at the same time. When LL opensourced the viewer, they split the repository, but because of interdependence between the server and client code, some files were duplicated between the two repositories. LSL related files overtime diverged, largely driven by Mono&#039;s server side compilation. So while it may seem strange now that the viewer contains server source, it wasn&#039;t at the time the article was written.&lt;br /&gt;
::-- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 19:08, 6 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
It&#039;s probably not very polite to bring up this link, but it may shed some light on the reasons behind usage of Bubble Sort and the presumption that it was used in the server code: [https://github.com/openmetaversefoundation/simian/blob/544379ec7fc85fabfbeb01c89bc168e46bc83452/Simian.Scripting.LindenApi/Lists.cs#LC464]. It mentions what it calls &amp;quot;type specific feathered sorting&amp;quot;, which I assume it to mean the individual sorting of elements of each type. The code claims that &amp;quot;unoptimized bubble sort&amp;quot; is the only way to achieve it. I haven&#039;t given it much thought yet, but I wonder if comb sort, as mentioned by Void, would also preserve that ordering. --[[User:Pedro Oval|Pedro Oval]] 03:09, 8 April 2014 (PDT)&lt;br /&gt;
: I think that 3 passes index, sort, write could do this as well. Miranda&#039;s comment in {{Jira|SVC-2988}} suggests that there is some other kind of overhead in there. --[[User:ObviousAltIsObvious Resident|ObviousAltIsObvious Resident]] 05:31, 8 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
:I&#039;ve tried Quicksort and Comb Sort. My input list was [3,2,1,3,3,4,3,3,1,4,1,9,3,6] with stride 2. llListSort returns [1,3,1,4,1,9,3,3,3,2,3,4,3,6]. I could not reproduce this result with Comb sort, not even pre-inverting the array nor by pre-inverting, sorting descending and post-inverting it. I&#039;ve tried two variations and all possible &#039;&#039;shrink&#039;&#039; values for this length. I&#039;ve also tried with Quicksort with a decent amount of possible choices of pivot (first, central, last, median, and sorting the first, central and last elements, using several variations of &amp;lt; and &amp;lt;= for median and sorting), to no avail. --[[User:Pedro Oval|Pedro Oval]] 07:01, 8 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
::I wish I had more time to play with this. Going by what is typically found in LL code, my first guess would be &amp;quot;whatever the GNU library is using in std::sort&amp;quot;. It could very well be a wrapper around that. Adding to fun, there are 2 major C++ libraries in GNU land, each uses a different approach. --[[User:ObviousAltIsObvious Resident|ObviousAltIsObvious Resident]] 07:30, 8 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
:::Boost? P.S. I&#039;ve looked at opensim code. I have no problem with us documenting opensim functions etc. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 08:58, 8 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
::::Same difference, as Boost uses std::sort: [http://svn.boost.org/svn/boost/trunk/boost/range/algorithm/sort.hpp]. Digging a bit I have found this: [http://en.wikipedia.org/wiki/Introsort#Implementations Introsort#Implementations (Wikipedia)] which made it sound like any attempt at reproducing the results without GNU libstdc++ was going to be too painful to be worth it. Then I&#039;ve tried with the C++11 program below; it was sorted in a stable way, as the result is: &amp;quot;1,3, 1,4, 1,9, 3,2, 3,4, 3,3, 3,6, &amp;quot;. I&#039;m willing to make more experiments but I&#039;m out of ideas at the moment. Any suggestions? (P.S.: who chose the colors for the C++ highlighter? Yuck!) --[[User:Pedro Oval|Pedro Oval]] 09:30, 9 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;cpp&amp;gt;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
#include &amp;lt;algorithm&amp;gt;&lt;br /&gt;
#include &amp;lt;vector&amp;gt;&lt;br /&gt;
&lt;br /&gt;
struct Rec&lt;br /&gt;
{&lt;br /&gt;
    int key;&lt;br /&gt;
    int data;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
bool sortByKey(const Rec &amp;amp;lhs, const Rec &amp;amp;rhs) { return lhs.key &amp;lt; rhs.key; }&lt;br /&gt;
&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
    std::vector&amp;lt;Rec&amp;gt; v = {{3,2},{1,3},{3,4},{3,3},{1,4},{1,9},{3,6}};&lt;br /&gt;
    std::sort(v.begin(), v.end(), sortByKey);&lt;br /&gt;
    for (Rec &amp;amp;n : v)&lt;br /&gt;
        std::cout &amp;lt;&amp;lt; n.key &amp;lt;&amp;lt; &amp;quot;,&amp;quot; &amp;lt;&amp;lt; n.data &amp;lt;&amp;lt; &amp;quot;, &amp;quot;;&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/cpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:tried substituting partial_sort (I think that bypasses the insertion sort libstdc++ likes to use on small sets), almost the same as LSL but not close enough. 1,4, 1,3, 1,9, 3,3, 3,2, 3,4, 3,6,  --[[User:ObviousAltIsObvious Resident|ObviousAltIsObvious Resident]] 15:34, 9 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I don t know why you are using boost c++ library .&lt;br /&gt;
Probably the key of the answer is inside the implementation of sort in the mono library .&lt;br /&gt;
&lt;br /&gt;
I dont know which version mono is , and which algorithm it uses for sort .&lt;br /&gt;
Nevertheless , the documentation from microsoft on dotnet c# gives :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
from [ http://msdn.microsoft.com/en-us/library/b0zbh7b6(v=vs.110).aspx ]&lt;br /&gt;
&lt;br /&gt;
 This method uses the Array.Sort method, which applies the introspective sort as follows:&lt;br /&gt;
 * If the partition size is fewer than 16 elements, it uses an insertion sort algorithm.&lt;br /&gt;
 * If the number of partitions exceeds 2 * LogN, where N is the range of the input array, it uses a Heapsort algorithm.&lt;br /&gt;
 * Otherwise, it uses a Quicksort algorithm.&lt;br /&gt;
 This implementation performs an unstable sort; that is, if two elements are equal, their order might not be preserved. &lt;br /&gt;
 In contrast, a stable sort   preserves the order of elements that are equal.&lt;br /&gt;
 On average, this method is an O(n log n) operation, where n is Count; in the worst case it is an O(n ^ 2) operation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We should verify if the actual version of mono used by linden uses the same strategy as microsoft.&lt;br /&gt;
But , at first view , it seems coherent with the actual observations&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other note : a bubble sort is O(n) if the list is already sorted . Some other algorithms too.&lt;br /&gt;
And some other algorithms , not.&lt;br /&gt;
But in LSL/mono , sortig an already sorted list don t make it faster &lt;br /&gt;
&lt;br /&gt;
[[User:Miranda Umino|Miranda Umino]] 20:55, 17 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
:The sort works the same under LSO, so I believe we can rule out a native .net library call as the source of this behavior. --[[User:ObviousAltIsObvious Resident|ObviousAltIsObvious Resident]] 00:29, 18 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
I&#039;m still researching, but I&#039;ll advance some information. I&#039;ve reproduced the results with this script, which implements a very simple sort algorithm that is not listed in Wikipedia:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
list Sort(list input, integer stride)&lt;br /&gt;
{&lt;br /&gt;
    integer i;&lt;br /&gt;
    integer j;&lt;br /&gt;
&lt;br /&gt;
    for (i = 0; i &amp;lt; llGetListLength(input) - stride; i += stride)&lt;br /&gt;
    {&lt;br /&gt;
        for (j = i + stride; j &amp;lt; llGetListLength(input); j += stride)&lt;br /&gt;
        {&lt;br /&gt;
            if (llList2Integer(input, i) &amp;gt; llList2Integer(input, j))&lt;br /&gt;
            {&lt;br /&gt;
                // Swap records i &amp;amp; j&lt;br /&gt;
                input = llListReplaceList(&lt;br /&gt;
                            llListReplaceList(input, llList2List(input, j, j+stride-1), i, i+stride-1),&lt;br /&gt;
                            llList2List(input, i, i+stride-1), j, j+stride-1);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    return input;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        list MyList = [3,2,1,3,3,4,3,3,1,4,1,9,3,6];&lt;br /&gt;
        string L1 = llList2CSV(llListSort(MyList, 2, TRUE));&lt;br /&gt;
        string L2 = llList2CSV(Sort(MyList, 2));&lt;br /&gt;
        llOwnerSay(&amp;quot;O: &amp;quot; + L1);&lt;br /&gt;
        llOwnerSay(&amp;quot;N: &amp;quot; + L2);&lt;br /&gt;
        if (L1 != L2) llOwnerSay(&amp;quot;Different&amp;quot;); else llOwnerSay(&amp;quot;Equal&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
// Output:&lt;br /&gt;
// [09:50:20] Sort: O: 1, 3, 1, 4, 1, 9, 3, 3, 3, 2, 3, 4, 3, 6&lt;br /&gt;
// [09:50:20] Sort: N: 1, 3, 1, 4, 1, 9, 3, 3, 3, 2, 3, 4, 3, 6&lt;br /&gt;
// [09:50:20] Sort: Equal&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I realized it was a candidate while trying to understand how bubble sort would preserve the ordering as claimed by the OpenSim code. I couldn&#039;t, so I looked into the code in more detail, and I realized that the sorting algorithm used was &#039;&#039;not&#039;&#039; bubble sort, but the one implemented in the above script. It&#039;s a naïve algorithm similar to selection sort, but less optimal: it goes through each element, and does a sweep over the rest of the elements to see if there&#039;s one less than it. If so, it swaps them (selection sort just takes note of the index position of the least element, and swaps them at the end of the inner loop instead of as it goes). At the end of each sweep, the element in question will have the least of the remaining elements in the list. It&#039;s still O(n²), and worse in performance than selection sort (since it does more swaps), but it does indeed guarantee preservation of the order of the types as claimed, assuming that comparison of two elements of different types does not cause a swap. It&#039;s also not stable, by its nature, and as proved by the results above. --[[User:Pedro Oval|Pedro Oval]] 10:09, 19 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Update:&#039;&#039;&#039; Selection Sort fails to reproduce the results, which is expected. However, the above algorithm matched the results every time I&#039;ve tried. I tested with this list generation code in place of the constant:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
        list MyList;&lt;br /&gt;
        while (llGetListLength(MyList) &amp;lt; 500)&lt;br /&gt;
        {&lt;br /&gt;
            MyList = MyList + (integer)llFrand(12) + llGetListLength(MyList);&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
It seems we have a winner. --[[User:Pedro Oval|Pedro Oval]] 10:51, 19 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Update 2:&#039;&#039;&#039; It gets better. Type feathering is NOT respected in case of a descending sort. OpenSim gives different results to SL in that case. It looks like type feathering is not a feature, but a side effect of the algorithm used. I&#039;ve reproduced the results by always swapping when the types are different. The results I got are consistent with this: the comparison function returns TRUE if A and B are of the same type and A is greater than B, and FALSE otherwise, and the swap is done if (the comparison function returns TRUE) &#039;&#039;&#039;xor&#039;&#039;&#039; (ascending!=1), causing it to &#039;&#039;always&#039;&#039; swap elements of different types for descending sort, thus destroying the feathering. OpenSim respects the feathering for descending order. --[[User:Pedro Oval|Pedro Oval]] 14:38, 19 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
One sure thing : llListSort is not O(N*N) . LLstsort is O(N * Log2(N) )&lt;br /&gt;
&lt;br /&gt;
Here some results of your algorithm ( 2nd column = number of pairs ; 3rd column time in frames per iteration)&lt;br /&gt;
 &lt;br /&gt;
 BubbleSort&lt;br /&gt;
 NumberTest       N size  Average Time in Frames  &lt;br /&gt;
 Test #1 with       2    0.020000&lt;br /&gt;
 Test #2 with       3    0.050000&lt;br /&gt;
 Test #3 with       4    0.090000&lt;br /&gt;
 Test #4 with       6    0.200000&lt;br /&gt;
 Test #5 with       8    0.200000&lt;br /&gt;
 Test #6 with      12    0.650000&lt;br /&gt;
 Test #7 with      16    0.970000&lt;br /&gt;
 Test #8 with      24    1.850000&lt;br /&gt;
 Test #9 with      32    2.300000&lt;br /&gt;
 Test #10 with     48    5.590000&lt;br /&gt;
 Test #11 with     64    7.540000&lt;br /&gt;
 Test #12 with     96    18.270000&lt;br /&gt;
 Test #13 with    128    28.950000&lt;br /&gt;
 Test #14 with    160    53.440000&lt;br /&gt;
 Test #15 with    192    71.920000&lt;br /&gt;
 Test #16 with    224    90.050000&lt;br /&gt;
 Test #17 with    256    112.140000&lt;br /&gt;
&lt;br /&gt;
Time ( 2*128 ) = (2*2)  * Time(128) =&amp;gt; ALgorithm is O(N*N)&lt;br /&gt;
&lt;br /&gt;
And with LListSort&lt;br /&gt;
 LListSort	&lt;br /&gt;
 Test #1 with       2    0.040000   &lt;br /&gt;
 Test #2 with       3    0.070000&lt;br /&gt;
 Test #3 with       4    0.040000&lt;br /&gt;
 Test #4 with       6    0.050000&lt;br /&gt;
 Test #5 with       8    0.070000&lt;br /&gt;
 Test #6 with      12    0.150000&lt;br /&gt;
 Test #7 with      16    0.080000&lt;br /&gt;
 Test #8 with      24    0.210000&lt;br /&gt;
 Test #9 with      32    0.320000&lt;br /&gt;
 Test #10 with     48    0.340000&lt;br /&gt;
 Test #11 with     64    0.430000&lt;br /&gt;
 Test #12 with     96    0.280000&lt;br /&gt;
 Test #13 with    128    0.670000&lt;br /&gt;
 Test #14 with    160    0.650000&lt;br /&gt;
 Test #15 with    192    0.760000&lt;br /&gt;
 Test #16 with    224    0.660000&lt;br /&gt;
 Test #17 with    256    0.840000&lt;br /&gt;
&lt;br /&gt;
Time ( 2*128 ) = 2*log(2) * Time(128) =&amp;gt; ALgorithm is O(N*LogN)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
list Sort(list input, integer stride)&lt;br /&gt;
{&lt;br /&gt;
    integer i;&lt;br /&gt;
    integer j;&lt;br /&gt;
 &lt;br /&gt;
    for (i = 0; i &amp;lt; llGetListLength(input) - stride; i += stride)&lt;br /&gt;
    {&lt;br /&gt;
        for (j = i + stride; j &amp;lt; llGetListLength(input); j += stride)&lt;br /&gt;
        {&lt;br /&gt;
            if (llList2Integer(input, i) &amp;gt; llList2Integer(input, j))&lt;br /&gt;
            {&lt;br /&gt;
                // Swap records i &amp;amp; j&lt;br /&gt;
                input = llListReplaceList(&lt;br /&gt;
                            llListReplaceList(input, llList2List(input, j, j+stride-1), i, i+stride-1),&lt;br /&gt;
                            llList2List(input, i, i+stride-1), j, j+stride-1);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    return input;&lt;br /&gt;
}&lt;br /&gt;
default {&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        list tests = [&lt;br /&gt;
            // Ascending lists&lt;br /&gt;
            2, TRUE,&lt;br /&gt;
            3, TRUE,&lt;br /&gt;
            4, TRUE,&lt;br /&gt;
            6, TRUE,&lt;br /&gt;
            8, TRUE, &lt;br /&gt;
            12, TRUE,&lt;br /&gt;
            16, TRUE,&lt;br /&gt;
            24, TRUE,&lt;br /&gt;
            32, TRUE,&lt;br /&gt;
            48, TRUE,&lt;br /&gt;
            64, TRUE,&lt;br /&gt;
            96, TRUE,&lt;br /&gt;
            128, TRUE,&lt;br /&gt;
            160, TRUE,&lt;br /&gt;
            192, TRUE,&lt;br /&gt;
            224, TRUE,&lt;br /&gt;
            256, TRUE&lt;br /&gt;
/*            320, TRUE,&lt;br /&gt;
            384, TRUE,&lt;br /&gt;
            448, TRUE,&lt;br /&gt;
            512, TRUE &lt;br /&gt;
            */&lt;br /&gt;
&lt;br /&gt;
        ];&lt;br /&gt;
        integer repetitions = 100;&lt;br /&gt;
        integer test = 0; integer testsLength = tests != [];&lt;br /&gt;
         &lt;br /&gt;
        integer listSize; integer ascending; integer i; list t;&lt;br /&gt;
        float f; string s; list l = [];&lt;br /&gt;
        float nFrameStart;&lt;br /&gt;
        float nFrameEnd;&lt;br /&gt;
        float overhead;&lt;br /&gt;
        llOwnerSay(&amp;quot;Starting tests…&amp;quot;);&lt;br /&gt;
        for (; test &amp;lt; testsLength; test += 2) {&lt;br /&gt;
            listSize = llList2Integer(tests, test);&lt;br /&gt;
            ascending = llList2Integer(tests, test + 1);&lt;br /&gt;
             &lt;br /&gt;
            if (ascending) {&lt;br /&gt;
                i = 0;&lt;br /&gt;
                for (; i &amp;lt; listSize; ++i) &lt;br /&gt;
                    l +=  [(integer)llFrand(3),llFrand(10000)] ;&lt;br /&gt;
            } else {&lt;br /&gt;
                i = listSize;&lt;br /&gt;
                while ((--i) &amp;gt;= 0) &lt;br /&gt;
                    l +=  (integer)llFrand(10000);&lt;br /&gt;
            }&lt;br /&gt;
             &lt;br /&gt;
            i = 0;&lt;br /&gt;
            nFrameStart = (float)llGetEnv(&amp;quot;frame_number&amp;quot;);&lt;br /&gt;
            for (; i &amp;lt; repetitions; ++i) &lt;br /&gt;
                t = [];&lt;br /&gt;
            nFrameEnd = (float)llGetEnv(&amp;quot;frame_number&amp;quot;);&lt;br /&gt;
            overhead = nFrameEnd - nFrameStart;&lt;br /&gt;
            i = 0;&lt;br /&gt;
            nFrameStart = (float)llGetEnv(&amp;quot;frame_number&amp;quot;);&lt;br /&gt;
            for (; i &amp;lt; repetitions; ++i) &lt;br /&gt;
               // t = llListSort(l, 2, ascending);&lt;br /&gt;
               t = Sort(l,2);&lt;br /&gt;
            nFrameEnd = (float)llGetEnv(&amp;quot;frame_number&amp;quot;);      &lt;br /&gt;
            f =  nFrameEnd - nFrameStart - overhead;&lt;br /&gt;
            t = l = [];&lt;br /&gt;
            &lt;br /&gt;
            f /= (float)repetitions;&lt;br /&gt;
            s = &amp;quot;\tTest #&amp;quot; + (string)((test / 2) + 1) + &amp;quot; with\t&amp;quot; + (string)listSize + &amp;quot;\t&amp;quot; + (string)( f ); &lt;br /&gt;
           &lt;br /&gt;
            llOwnerSay(s);&lt;br /&gt;
        }&lt;br /&gt;
        llOwnerSay(&amp;quot;Tests complete.&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
--[[User:Miranda Umino|Miranda Umino]] 21:41, 19 April 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:It&#039;s definitively quadratic, i.e. O(n²). http://inky.ws/g/2zz --[[User:Pedro Oval|Pedro Oval]] 19:39, 5 May 2014 (PDT)&lt;br /&gt;
:&#039;&#039;&#039;Update:&#039;&#039;&#039; Added benchmarking script to the linked gallery. --[[User:Pedro Oval|Pedro Oval]] 06:15, 6 May 2014 (PDT)&lt;br /&gt;
:&#039;&#039;&#039;Update 2:&#039;&#039;&#039; I tried the same benchmarking script listed in Inky under LSO and the strangest thing happened. I changed the list addition line to use the &amp;lt;code&amp;gt;(MyList = []) + MyList&amp;lt;/code&amp;gt; trick, which allowed for an extra batch of 50. Here are the results I got:&lt;br /&gt;
:{| {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
!N !! Time&lt;br /&gt;
|-&lt;br /&gt;
|50 || 3.333132&lt;br /&gt;
|-&lt;br /&gt;
|100 || 6.786429&lt;br /&gt;
|-&lt;br /&gt;
|150 || 13.334011&lt;br /&gt;
|-&lt;br /&gt;
|200 || 13.333488&lt;br /&gt;
|-&lt;br /&gt;
|250 || 13.333256&lt;br /&gt;
|-&lt;br /&gt;
|300 || 13.333005&lt;br /&gt;
|-&lt;br /&gt;
|350 || 13.332855&lt;br /&gt;
|-&lt;br /&gt;
|400 || 13.334793&lt;br /&gt;
|-&lt;br /&gt;
|450 || 13.334989&lt;br /&gt;
|-&lt;br /&gt;
|500 || 13.332029&lt;br /&gt;
|}&lt;br /&gt;
:Looks like under LSO the function is being throttled. --[[User:Pedro Oval|Pedro Oval]] 13:36, 6 May 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Update 3:&#039;&#039;&#039; It seems it&#039;s throttled under Mono as well, just not so much. I&#039;ve added to the [http://inky.ws/g/2zz gallery] a graphic with a benchmark over the first 200-300 values, going through them one at a time. The delay seems roughly linear on N up to about N=80. Then it gets constant (to almost 3 seconds, actually about 2.95 or 2.97, according to the data, meaning almost 10 ms per call) until the actual time the function takes overtakes the throttle. When does that happen, depends on what is being compared (I used integers and vectors because they have a noticeably different comparison time) and on the performance of the sim (green line was taken on a faster sim).&lt;br /&gt;
:The benchmarking script is the same, just setting Step=1 and MaxN=300. The vectors were constant, set to &amp;lt;1,2,3&amp;gt;. For the descending test, I just changed all TRUE to FALSE. The first run is up to N=200 only because I thought it was enough, but when I finished and graphed it, it wasn&#039;t clear enough from the results I got, so I raised it to 300.&lt;br /&gt;
:I conjecture that the spikes are GC kicking in and may depend on available memory. The sim I went to to take the sample with the green line was much emptier. --[[User:Pedro Oval|Pedro Oval]] 05:07, 19 May 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Merge Sort in LSL ==&lt;br /&gt;
&lt;br /&gt;
I&#039;ve written a Merge Sort that&#039;s nearly comparable to the llListSort provided by LSL. It supports strided lists (as in the example below), but cannot reverse the order as llListSort does. I ran this test a few times on it, and surprisingly, it&#039;s faster than llListSort. The code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;list elements = [8.627350, &amp;quot;a3c6cf64-8daf-b6ca-9851-8a49a597fafc&amp;quot;, 18.943806, &amp;quot;3e0a230a-16ef-f539-b070-0ef0a16b1835&amp;quot;, 6.843595, &amp;quot;aa3183b2-a5ad-abb3-98c2-c07517c049b5&amp;quot;, 5.199630, &amp;quot;513ec659-a280-5ea4-ab3c-5f3a5544820e&amp;quot;, 14.510715, &amp;quot;7f1f52bc-c63f-aef0-73c9-cd97f1bddccc&amp;quot;, 12.230530, &amp;quot;3c719f4f-072d-b35f-9fe6-ed157e06c487&amp;quot;, 3.188807, &amp;quot;a84db094-9630-79fc-eb02-74bcbd030190&amp;quot;, 1.648486, &amp;quot;e0a8af06-2c43-57df-9571-22c035424acc&amp;quot;, 8.481318, &amp;quot;891c3eba-3723-29c4-f1ea-032b6dad2b1b&amp;quot;, 17.444149, &amp;quot;e4b04775-8d68-0d4a-773f-19f02c112066&amp;quot;];&lt;br /&gt;
&lt;br /&gt;
list merge(list left, list right, integer stride)&lt;br /&gt;
{&lt;br /&gt;
    list result;&lt;br /&gt;
    &lt;br /&gt;
    while(llGetListLength(left) &amp;gt; 0 || llGetListLength(right) &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        if(llGetListLength(left) &amp;gt; 0 &amp;amp;&amp;amp; llGetListLength(right) &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            // Ensure we&#039;re comparing the same things...&lt;br /&gt;
            if(llGetListEntryType(left, 0) == llGetListEntryType(right, 0))&lt;br /&gt;
            {&lt;br /&gt;
                // Get values in a re-cast-able form&lt;br /&gt;
                integer type = llGetListEntryType(left, 0);&lt;br /&gt;
                string InitialLeftValue = llList2String(left, 0);&lt;br /&gt;
                string InitialRightValue = llList2String(right, 0);&lt;br /&gt;
                &lt;br /&gt;
                // Handle all type cases&lt;br /&gt;
                &lt;br /&gt;
                if(type == TYPE_INTEGER)&lt;br /&gt;
                {&lt;br /&gt;
                    integer leftValue = (integer)InitialLeftValue;&lt;br /&gt;
                    integer rightValue = (integer)InitialRightValue;&lt;br /&gt;
                    &lt;br /&gt;
                    if(leftValue &amp;lt;= rightValue)&lt;br /&gt;
                    {&lt;br /&gt;
                        result += llList2List(left, 0, 1);&lt;br /&gt;
                        left = llDeleteSubList(left, 0, stride - 1);&lt;br /&gt;
                    }&lt;br /&gt;
                    else&lt;br /&gt;
                    {&lt;br /&gt;
                        result += llList2List(right, 0, 1);&lt;br /&gt;
                        right = llDeleteSubList(right, 0, stride - 1);&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
                else if(type == TYPE_FLOAT)&lt;br /&gt;
                {&lt;br /&gt;
                    float leftValue = (float)InitialLeftValue;&lt;br /&gt;
                    float rightValue = (float)InitialRightValue;&lt;br /&gt;
                    &lt;br /&gt;
                    if(leftValue &amp;lt;= rightValue)&lt;br /&gt;
                    {&lt;br /&gt;
                        result += llList2List(left, 0, 1);&lt;br /&gt;
                        left = llDeleteSubList(left, 0, stride - 1);&lt;br /&gt;
                    }&lt;br /&gt;
                    else&lt;br /&gt;
                    {&lt;br /&gt;
                        result += llList2List(right, 0, 1);&lt;br /&gt;
                        right = llDeleteSubList(right, 0, stride - 1);&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
                else if(type == TYPE_VECTOR)&lt;br /&gt;
                {&lt;br /&gt;
                    float leftValue = llVecMag((vector)InitialLeftValue);&lt;br /&gt;
                    float rightValue = llVecMag((vector)InitialRightValue);&lt;br /&gt;
                    &lt;br /&gt;
                    if(leftValue &amp;lt;= rightValue)&lt;br /&gt;
                    {&lt;br /&gt;
                        result += llList2List(left, 0, 1);&lt;br /&gt;
                        left = llDeleteSubList(left, 0, stride - 1);&lt;br /&gt;
                    }&lt;br /&gt;
                    else&lt;br /&gt;
                    {&lt;br /&gt;
                        result += llList2List(right, 0, 1);&lt;br /&gt;
                        right = llDeleteSubList(right, 0, stride - 1);&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
                else if(type == TYPE_ROTATION)&lt;br /&gt;
                {&lt;br /&gt;
                    float leftValue = llRot2Angle((rotation)InitialLeftValue);&lt;br /&gt;
                    float rightValue = llRot2Angle((rotation)InitialRightValue);&lt;br /&gt;
                    &lt;br /&gt;
                    if(leftValue &amp;lt;= rightValue)&lt;br /&gt;
                    {&lt;br /&gt;
                        result += llList2List(left, 0, 1);&lt;br /&gt;
                        left = llDeleteSubList(left, 0, stride - 1);&lt;br /&gt;
                    }&lt;br /&gt;
                    else&lt;br /&gt;
                    {&lt;br /&gt;
                        result += llList2List(right, 0, 1);&lt;br /&gt;
                        right = llDeleteSubList(right, 0, stride - 1);&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        else if(llGetListLength(left) &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            result += llList2List(left, 0, 1);&lt;br /&gt;
            left = llDeleteSubList(left, 0, stride - 1);&lt;br /&gt;
        }&lt;br /&gt;
        else if(llGetListLength(right) &amp;gt; 0)&lt;br /&gt;
        {&lt;br /&gt;
            result += llList2List(right, 0, 1);&lt;br /&gt;
            right = llDeleteSubList(right, 0, stride - 1);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    return result;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
list llListSortFast(list in, integer stride)&lt;br /&gt;
{&lt;br /&gt;
    if(llGetListLength(in) &amp;lt;= stride)&lt;br /&gt;
    {&lt;br /&gt;
        return in;&lt;br /&gt;
    }&lt;br /&gt;
    integer middle = (llGetListLength(in) / stride) / 2;&lt;br /&gt;
    &lt;br /&gt;
    list left = llList2List(in, 0, (middle) * stride - 1);&lt;br /&gt;
    list right = llList2List(in, middle * stride, -1);&lt;br /&gt;
    &lt;br /&gt;
    left = llListSortFast(left, stride);&lt;br /&gt;
    right = llListSortFast(right, stride);&lt;br /&gt;
    &lt;br /&gt;
    return merge(left, right, stride);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSay(0, &amp;quot;Input: \n Merge Sort:&amp;quot; + llList2CSV(elements));&lt;br /&gt;
        float time = llGetAndResetTime();&lt;br /&gt;
        llSay(0, &amp;quot;Sorted Result: \n&amp;quot; + llList2CSV(llListSortFast(elements, 2)));&lt;br /&gt;
        llSay(0, &amp;quot;Time Taken: &amp;quot; + (string)time);&lt;br /&gt;
        time = llGetAndResetTime();&lt;br /&gt;
        llSay(0, &amp;quot;Bubble Sort Result: \n&amp;quot; + llList2CSV(llListSort(elements, 2, TRUE)));&lt;br /&gt;
        llSay(0, &amp;quot;Time Taken: &amp;quot; + (string)time);&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Can others proofread and/or test this with other values and confirm that I am not producing false results?&lt;br /&gt;
&lt;br /&gt;
If does turn out to be more efficient, please feel free to use it in your own projects.&lt;br /&gt;
&lt;br /&gt;
::I&#039;m afraid your timing system is faulty. You&#039;re not reading the times at the right points in your code. I&#039;m afraid on an admitedly very quick test llListSort() wins by a long chalk. Never-the-less, bravo on getting your merge sort to work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
    touch_start(integer num)&lt;br /&gt;
    {&lt;br /&gt;
&lt;br /&gt;
        llSay(0, &amp;quot;Input: \n Merge Sort:&amp;quot; + llList2CSV(elements));&lt;br /&gt;
        llResetTime();&lt;br /&gt;
        list lx = ListSortFast(elements, 2);&lt;br /&gt;
        float time = llGetTime();&lt;br /&gt;
        llSay(0, &amp;quot;Time Taken MergeSort: &amp;quot; + (string)time);&lt;br /&gt;
        llSay(0, &amp;quot;Sorted Result: \n&amp;quot; + llList2CSV(lx));&lt;br /&gt;
        &lt;br /&gt;
        llSleep(1);&lt;br /&gt;
        llResetTime();&lt;br /&gt;
        lx = llListSort(elements, 2, TRUE);&lt;br /&gt;
        time = llGetTime();&lt;br /&gt;
        llSay(0, &amp;quot;Time Taken llListSort: &amp;quot; + (string)time); &lt;br /&gt;
        llSay(0, &amp;quot;Bubble Sort Result: \n&amp;quot; + llList2CSV(lx));&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
p.s. On a test of 5000 sorts of your data, the merge sort is 5.5 times slower than llListSort(). Sorry!&lt;br /&gt;
[[User:Omei Qunhua|Omei Qunhua]] 15:09, 22 May 2014 (PDT)&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Talk:LSL_Portal&amp;diff=1195398</id>
		<title>Talk:LSL Portal</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Talk:LSL_Portal&amp;diff=1195398"/>
		<updated>2015-01-31T16:58:15Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: /* Tiny font in script samples */ Reason&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL Header}}{{Talk}}&lt;br /&gt;
= Please do not copy content from LSLwiki =&lt;br /&gt;
&lt;br /&gt;
From [http://forums.secondlife.com/showpost.php?p=1392697&amp;amp;postcount=44 Rob Linden&#039;s post to the forum]:&lt;br /&gt;
:Hi folks, sorry for dropping into this conversation late. I haven&#039;t read through everything here, but I&#039;d like to present an alternative.&lt;br /&gt;
&lt;br /&gt;
:There have been several requests that Linden Lab take on the hosting of the LSL wiki. There are several problems with us doing this work. The primary problem is the question of ownership of the material. Since, to the best of our knowledge, there was never an explicit, consistent notice of ownership of this material throughout its creation, nor a clear assignment/license associated with contributing more material, it would seem the only safe way to license this content would be to contact every single contributor throughout the life of the wiki and get an explicit license or copyright assignment from them. Note that I said &amp;quot;safe&amp;quot;, not &amp;quot;practical&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
:We&#039;re not in a position to go down that road. However, we do have wiki.secondlife.com, which has had, since day one, a very clear notice about the license under which contributions are made and distributed. We would be very happy to see the community collaborate on newly created content on wiki.secondlife.com. As long as you author the content (not cut and paste from sources you are not the sole author of), we welcome your contribution. -- [[User:Rob Linden|Rob Linden]] 14:30, 24 January 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
OK, so let&#039;s talk about formatting rules for entries.&lt;br /&gt;
&lt;br /&gt;
(Moved to [[LSL Portal Guidelines]], so that this talk doesn&#039;t get too cluttered.) -- [[User:Talarus Luan|Talarus Luan]] 16:32, 24 January 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
[[User:Talarus Luan|Talarus Luan]] 14:28, 24 January 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=Other Discussion=&lt;br /&gt;
&lt;br /&gt;
== LSL Guide lost ==&lt;br /&gt;
&lt;br /&gt;
http://svn.secondlife.com/trac/linden/changeset/1392&lt;br /&gt;
linked from the page history &lt;br /&gt;
says new residents downloading the client won&#039;t be getting a copy of the LSL_Guide.html any more ...&lt;br /&gt;
&lt;br /&gt;
Q1. Where on the web do new residents go to get the LSL_Guide now? -- [[User:Ppaatt Lynagh|Ppaatt Lynagh]] 16:17, 3 January 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
Q2. How should this [[LSL Portal]] page tell new residents to be sure to read the LSL_Guide first to correctly understand what else we say here? -- [[User:Ppaatt Lynagh|Ppaatt Lynagh]] 16:17, 3 January 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Untitled Chat ==&lt;br /&gt;
&lt;br /&gt;
Should we make this the front page to the LSL reference, or put that one more level down?  I kinda lean toward the former.  [[User:Gigs Taggart|Gigs Taggart]] 14:09, 24 January 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Yeah i think so... (Unsigned by Dimentox Travanti}&lt;br /&gt;
:Remember to sign your post with four tildes. [[User:Gigs Taggart|Gigs Taggart]] 14:26, 24 January 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I used a modified version of the [http://meta.wikimedia.org/wiki/User:Ajqnic:GeSHiHighlight GeSHiHighlight] plugin for MediaWiki.  With an LSL syntax file.  The license for the plugin and for [http://qbnz.com/highlighter/ GeSHi] is GPL, it also requires another plugin [http://meta.wikimedia.org/wiki/User:Ajqnic:purgePage purgePage].&lt;br /&gt;
--[[User:Thraxis Epsilon|Thraxis Epsilon]] 15:00, 24 January 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
== Regarding copying content from the existing Wiki ==&lt;br /&gt;
&lt;br /&gt;
This isn&#039;t clear from Rob&#039;s post, but it should be made clear: we CAN copy our OWN content from the existing wiki. IE, I plan to copy/paste my XML-RPC notes from the existing one. Does that present an issue? If so, why?&lt;br /&gt;
[[User:Talarus Luan|Talarus Luan]] 16:03, 24 January 2007 (PST)&lt;br /&gt;
:If you are the sole author, it wouldn&#039;t.  Just be careful and check the page history.   [[User:Gigs Taggart|Gigs Taggart]] 16:10, 24 January 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
== Syntax Highlighting ==&lt;br /&gt;
&lt;br /&gt;
Updated info on the syntax highlighting is available here [[http://rpgstats.com/wiki/index.php?title=GeSHiHiLight.php GeSHiHiLight]]&lt;br /&gt;
--[[User:Thraxis Epsilon|Thraxis Epsilon]] 16:10, 24 January 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
:Lets hope they include it soon ^^ [[User:Strife Onizuka|Strife Onizuka]] 21:21, 24 January 2007 (PST)&lt;br /&gt;
:Is there anyone we can ask? [[User:Dimentox Travanti|Dimentox Travanti]] 10:50, 25 January 2007 (PST)&lt;br /&gt;
:any news or update on this? [[User:Blueman Steele|Blueman Steele]] 6:12, 10 February 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
::We tried to use start using this on Thursday, but ran into some problems.  Thraxis, it&#039;ll help if you can contact me privately to discuss some of the issues. -- [[User:Rob Linden|Rob Linden]] 00:37, 11 February 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
:What&#039;s the status of syntax highlighting? --[[User:Mokelembembe Mokeev|Mokelembembe Mokeev]] 15:11, 24 April 2007 (PDT)&lt;br /&gt;
&lt;br /&gt;
::No one has made any efforts recently to get the highlighter included in the wiki. If you are going to post highlighted code, it would be good to have it output in such a way that keywords link to their appropriate pages. -- [[User:Strife Onizuka|Strife Onizuka]] 16:53, 24 April 2007 (PDT)&lt;br /&gt;
&lt;br /&gt;
:Talked with Rob Liden - The concern with the script is about security and the possiblity of injecting PHP code into the script hilighting. Since its a possible security issue he would like somebody at Linden to look into and fix it. I&#039;m going to look into the script and tell Rob what I found also. --[[User:Mokelembembe Mokeev|Mokelembembe Mokeev]] 15:29, 4 May 2007 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Let&#039;s refer to this simply as the &amp;quot;LSL portal&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
Since there&#039;s already something out there called the &amp;quot;LSLwiki&amp;quot;, let&#039;s refer to this as the LSL Portal to distinguish it.  If there&#039;s no objection, I&#039;ll move the pages with &amp;quot;LSL Wiki&amp;quot; in the title to some other appropriate name -- [[User:Rob Linden|Rob Linden]] 17:09, 24 January 2007 (PST)&lt;br /&gt;
:No objections here. :) I just updated [[LSL Wiki To-do]] with some assignment tables. I went ahead and moved it to [[LSL Portal To-do]] [[User:Talarus Luan|Talarus Luan]] 18:12, 24 January 2007 (PST)&lt;br /&gt;
:: Simple, consistent messaging: I&#039;ve gotten into the habit of using &amp;quot;LSL Portal&amp;quot; regularly myself.&lt;br /&gt;
:: --[[User:Torley Linden|Torley Linden]] 10:40, 31 January 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
== A way back... ==&lt;br /&gt;
&lt;br /&gt;
Every page should have a header that goes back to the portal index not the wiki index.&lt;br /&gt;
if we could even geta link in the left hand would be great.&lt;br /&gt;
&lt;br /&gt;
[[User:Dimentox Travanti|Dimentox Travanti]] 10:47, 25 January 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
: I second the idea of a link in the main Navigation list.  It makes it a lot easier to access the LSL Portal.&lt;br /&gt;
: [[User:Cron Stardust|Cron Stardust]] 11:25, 5 March 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
== Transitions ==&lt;br /&gt;
Encouraging to see this happening — and to see [http://www.lslwiki.org/ a second mirror] for the [http://www.lslwiki.com LSL wiki] too; hopefully I haven&#039;t come too late, because these developments look like they&#039;ve transpired over the last few days.&lt;br /&gt;
&lt;br /&gt;
Just wanted to let you know I&#039;ve added a link to our LSL Portal from our blog&#039;s Notices; it&#039;ll be up for some time. I&#039;m also going to add a simple article to the [http://secondlife.com/knowledgebase/ Knowledge Base] directing to this LSL Portal, since it&#039;s important to get more contributors aware, interested, and involved.&lt;br /&gt;
&lt;br /&gt;
I&#039;d like to personally be more active in this wiki... great things are afoot. I&#039;ve been spread across too many [http://secondlife.com/knowledgebase/article.php?id=357 communication channels] lately, so I&#039;ve been rotating between focuses (foci?); hopefully next week I&#039;ll have more hands-on energy here.&lt;br /&gt;
&lt;br /&gt;
Thanx to each and all of you building up this resource so far!&lt;br /&gt;
&lt;br /&gt;
--[[User:Torley Linden|Torley Linden]] 10:21, 26 January 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
== LSL Header/Footer ==&lt;br /&gt;
Below is the header/footer template: &amp;lt;nowiki&amp;gt;{{LSL Header}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
{{LSL Header}}&lt;br /&gt;
Also, since &amp;lt;nowiki&amp;gt;&amp;lt;lsl&amp;gt;&amp;lt;/lsl&amp;gt;&amp;lt;/nowiki&amp;gt; tags don&#039;t seem to work yet, I used &amp;lt;nowiki&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;/nowiki&amp;gt;... hope that&#039;s alright, I know nothing about wikis except what I&#039;ve taught myself tonight. --[[User:DoteDote Edison|DoteDote Edison]] 20:45, 27 January 2007 (EST)&lt;br /&gt;
:Actually, go ahead and use the &amp;lt;nowiki&amp;gt;&amp;lt;lsl&amp;gt;&amp;lt;/lsl&amp;gt;&amp;lt;/nowiki&amp;gt; tags. Even though it may look like crap right this minute, as soon as the module is installed, it will instantly be perfect. :) [[User:Talarus Luan|Talarus Luan]] 14:59, 29 January 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
== LSL wiki-namespace ==&lt;br /&gt;
&lt;br /&gt;
All the LSL pages are prefixed with &amp;quot;LSL &amp;quot;, like &amp;quot;LSL Portal&amp;quot;, &amp;quot;LSL LLRand&amp;quot;, etc.  It would seem more justly to use the wiki-namespace &amp;quot;LSL:&amp;quot;.  Change the names from &amp;quot;LSL LLRand&amp;quot; to &amp;quot;LSL:LLRand&amp;quot;.  My 2 lindens. [[User:Dzonatas Sol|Dzonatas Sol]] 00:28, 2 February 2007 (PST) &lt;br /&gt;
:Just thought about this little more. We could use subpages instead of namespaces, then the talk pages will fully work.  &amp;quot;LSL/LLRand&amp;quot; for example [[User:Dzonatas Sol|Dzonatas Sol]] 00:41, 2 February 2007 (PST)&lt;br /&gt;
::I&#039;m not going to make a big fuss about it, but I&#039;d prefer if, per the [[Editing Guidelines]], that the page just be called &amp;quot;LLRand&amp;quot;. -- [[User:Rob Linden|Rob Linden]] 01:06, 2 February 2007 (PST)&lt;br /&gt;
:As this wiki has grown a great deal in other aspects the need for a namespace for LSL: has become even greater. This would allow the search functions to isolate LSL results from the more general content unrelated to LSL. This would also start a shift from many listings being sorted entirely under &#039;&#039;&#039;L&#039;&#039;&#039;. — [[User:Kizmut Smit|kizmut]]&amp;lt;span style=&amp;quot;letter-spacing: -2px&amp;quot;&amp;gt;&amp;lt;sup&amp;gt;[[User Talk:Kizmut Smit|T]]&amp;lt;/sup&amp;gt;/&amp;lt;sub&amp;gt;[[Special:Contributions/Kizmut Smit|C]]&amp;lt;/sub&amp;gt;&amp;lt;/span&amp;gt; 12:02, 14 June 2012 (PDT)&lt;br /&gt;
&lt;br /&gt;
== LSL conformance test ==&lt;br /&gt;
&lt;br /&gt;
Hi folks, we&#039;re planning to consolidate a lot of our scattered LSL conformance tests on this wiki.  I created two rather crude templates: [[Template:LSL conformance test]] and [[Template:LSL conformance script]], which were created for adding our conformance suite.  See [[LSL llGetUnixTime test]] for an example.  I&#039;d like to get a sense from people if this is a sensible way to do this.  The idea is to get these templates stabilized, and that will provide us a mechanism for those of us at LL to consolidate our tests.  Of course, if the community wants to chip in, that&#039;s great too...having items in our standard LSL conformance suite makes it less likely that we&#039;ll break an LSL feature that&#039;s important to you. -- [[User:Rob Linden|Rob Linden]] 22:53, 7 February 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
== LSL Categories List ==&lt;br /&gt;
What about a vertical list of categories down the right side of the LSL Portal front page?  The right-side list on the original wiki was my primary source of navigation, but maybe I&#039;m odd.  I could add it myself, but I&#039;m not sure how to make it automatically update the list as new categories are added. --[[User:DoteDote Edison|DoteDote Edison]] 20:20, 9 February 2007 (EST)&lt;br /&gt;
:Oops... right after I posted this, I noticed that it&#039;s item #4 on the &amp;quot;To-Do&amp;quot; list.  I went ahead and modified the front page to add a cetagories list.  If you don&#039;t like it, feel free to revert.  --[[User:DoteDote Edison|DoteDote Edison]] 20:55, 9 February 2007 (EST)&lt;br /&gt;
:The names all start with &amp;quot;LSL&amp;quot; and the names are not optimal for listing... The names could be changed though. I&#039;ll dig though the MediaWiki commands later and see if I can find any that would work well in this case. I don&#039;t have high hopes in this case. [[User:Strife Onizuka|Strife Onizuka]] 18:59, 9 February 2007 (PST)&lt;br /&gt;
Is the 200 articles per category page a mediawiki limit, or can we change it to 400 per page in a configuration somewhere? [[User:DoteDote Edison|DoteDote Edison]] 21:50, 22 February 2007 (EST)&lt;br /&gt;
&lt;br /&gt;
:If there&#039;s an issue with seeing all the pages, I can add the alphabetical navigation template later.&lt;br /&gt;
:[[User:SignpostMarv Martin|SignpostMarv Martin]] 06:16, 23 February 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
== Internationalizing ==&lt;br /&gt;
&lt;br /&gt;
How do we want to go about internationalizing the LSL wiki. It should probably be tied into the global wiki effort. [[User:Strife Onizuka|Strife Onizuka]] 07:20, 11 February 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
:With modular templates (e.g. the way I do them) vs monolithic templates (e.g. the way you do them), the templates won&#039;t need to be changed, only the content going into them. Regarding [[User talk:SignpostMarv Martin/Sandbox/Project:Internationalisation#multi-lingual articles|Project:Internationalisation#multi-lingual articles]], I have some freaky ideas to make maintenance of the LSL-specific multi-lingual articles a little easier to maintain.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;p.s. I&#039;m not sure whether Internationalisation of the LSL articles should be discussed here or [[User talk:SignpostMarv Martin/Sandbox/Project:Internationalisation#multi-lingual articles|there]].&amp;lt;br /&amp;gt;[[User:SignpostMarv Martin|SignpostMarv Martin]] 08:05, 11 February 2007 (PST) [[Talk:LSL_Function_Style|Moved from Talk:LSL_Function_Style]]&lt;br /&gt;
&lt;br /&gt;
::But your idea on templates don&#039;t provide structure, it requires the user to provide the structure and if we want to change the layout of the pages we need to go through and change ever single page. I&#039;m pretty sure I can put together template-templates that should make translating the templates easy as setting a few variables. We wouldn&#039;t be using the template-template directly for rendering but use [http://meta.wikimedia.org/wiki/Help:Substitution substitution]. Changing a dozen monolithic templates is better then changing a dozen * 328 pages. Also means that you get the same translation ever single time.&amp;lt;br/&amp;gt;I&#039;ve been thinking i could modify the LSLC, LSLG, LSLGC templates to support automated linking in language specific subpages. So if the page you are on is in Spanish, the links will lead to pages in Spanish if they exist. No special modifications to the links needed.[[User:Strife Onizuka|Strife Onizuka]] 06:43, 13 February 2007 (PST)&lt;br /&gt;
:::&#039;&#039;But your idea on templates don&#039;t provide structure, it requires the user to provide the structure&#039;&#039;&lt;br /&gt;
:::* That&#039;s kinda the point. Look at what information will need to be reused over and over again, and put it into a small template. Then those templates can be used directly, or as part of a wrapper template.&lt;br /&gt;
:::&#039;&#039;I&#039;m pretty sure I can put together template-templates that should make translating the templates easy as setting a few variables.&#039;&#039;&lt;br /&gt;
:::* The templates don&#039;t need translating, just the content.&lt;br /&gt;
:::&#039;&#039;I&#039;ve been thinking i could modify the LSLC, LSLG, LSLGC templates to support automated linking in language specific subpages. So if the page you are on is in Spanish, the links will lead to pages in Spanish if they exist.&#039;&#039;&lt;br /&gt;
:::* That would be bad.&lt;br /&gt;
:::* Better idea to follow.&lt;br /&gt;
:::[[User:SignpostMarv Martin|SignpostMarv Martin]] 13:13, 13 February 2007 (PST)&lt;br /&gt;
:::[[Template:Multi-lang]] I&#039;ve given up fixing the bugs in that, but you get the idea behind it&#039;s intent. Include [[Help:Getting_started_in_Second_Life/langs]] in your test page and &amp;lt;nowiki&amp;gt;{{#vardefine:article-lang}}&amp;lt;/nowiki&amp;gt; to either &#039;&#039;&#039;spa&#039;&#039; or &#039;&#039;&#039;eng&#039;&#039;&#039;.&lt;br /&gt;
:::Please fork the code into your own userspace if you&#039;re going to work on it (unless you know of an instant fix) to prevent edit collisions.&lt;br /&gt;
:::I&#039;ve also started work on [[Template:ISO_639-3/native]] to save a bit of time with entering languages that one browser might not be configured for (e.g. the higher-end UTF-8 characters)&lt;br /&gt;
:::[[User:SignpostMarv Martin|SignpostMarv Martin]] 22:08, 19 February 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
:[[User:CatherinePfeffer|Catherine Pfeffer]] Starting translation of the LSL Portal to French with the group &amp;quot;Constructeurs et scripteurs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
: Please refer to a related discussion on [[Project:Languages]].  -- [[User:Alissa Sabre|Alissa Sabre]] 07:58, 4 November 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
== phasing out of [[Template:LSLG]] ==&lt;br /&gt;
&lt;br /&gt;
Since the need to prefix almost everything with LSL_ is now being removed, all articles that are calling [[Template:LSLG]] should be edited to use a Wiki link, as the template is now rather redundant. &lt;br /&gt;
&lt;br /&gt;
The list of articles calling [[Template:LSLG|LSLG]] can be viewed via [https://wiki.secondlife.com/w/index.php?title=Special:Whatlinkshere&amp;amp;target=Template%3ALSLG Special:Whatlinkshere].&lt;br /&gt;
&amp;lt;br /&amp;gt;[[User:SignpostMarv Martin|SignpostMarv Martin]] 22:08, 19 February 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
:I think the pages in the {{LSLGC|FixMe}} category should be of a higher priority. Phasing out usage is reasonable, going through every page that uses it on the other hand just to remove it would be a waste of resources. I&#039;m a bit nervous about stopping using it at present, the metaphoric paint hasn&#039;t even dried on the move yet. Considering it doesn&#039;t effect the rendering, phasing it&#039;s usage out is appropriate. [[User:Strife Onizuka|Strife Onizuka]] 23:20, 20 February 2007 (PST)&lt;br /&gt;
::Waste of resources ?&lt;br /&gt;
::Isn&#039;t it a waste of resources to use a template that in most cases is entirely redundant ?&lt;br /&gt;
::[[User:SignpostMarv Martin|SignpostMarv Martin]] 02:23, 21 February 2007 (PST)&lt;br /&gt;
:::We haven&#039;t even finihed moving the function pages to the new names and template yet.  You could help with that instead of worrying about templates, you know. [[User:Gigs Taggart|Gigs Taggart]] 07:35, 21 February 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
== The original LSL Wiki is back! ==&lt;br /&gt;
Catherine Omega&#039;s [http://www.lslwiki.net original LSL Wiki] is back. She mentioned:&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&amp;quot;This is DEFINITELY back. And it&#039;s definitely permanent. It&#039;s all editable. And it&#039;s the &#039;official&#039;, Catherine-Omega-approved one.&amp;quot;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[http://www.catherineomega.com/2007/37/the-lsl-wiki-finds-a-new-home Further context can be found @ her blog.] --[[User:Torley Linden|Torley Linden]] 13:41, 28 February 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
== Table ==&lt;br /&gt;
&lt;br /&gt;
I&#039;ve been playing with the table (again). I&#039;ve tried to get it so it looks decent in both IE and Firefox. I&#039;ve been trying to get it to put all the extra space into the last section, which I managed in Firefox but haven&#039;t figured out the correct permutation of parameters for IE. I&#039;m content at this moment to leave it be (I use Firefox). [[User:Strife Onizuka|Strife Onizuka]] 08:49, 17 March 2007 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Warning notice? ==&lt;br /&gt;
&lt;br /&gt;
Might it be an idea to include a short warning on the top of this page that the LSL Portal is as yet incomplete?&lt;br /&gt;
&lt;br /&gt;
I just spent a while trying to find a list function I knew existed, but couldn&#039;t remember the exact name of, which hasn&#039;t made it here yet before realising that not all functions are listed yet.&lt;br /&gt;
--[[User:Nick Shatner|Nick Shatner]], 02:56, 2 May 2007 (PDT)&lt;br /&gt;
&lt;br /&gt;
:The vast majority of functions have been catagorized so if you had started from the {{LSLGC|List|list category page}} you probably would have found it. There are a small handful of functions that haven&#039;t been catagorized beyond the {{LSLGC|Functions}} category. I&#039;m not sure if a warning is warranted but I do recognize there are gaps in the LSL information. -- [[User:Strife Onizuka|Strife Onizuka]] 13:31, 2 May 2007 (PDT)&lt;br /&gt;
&lt;br /&gt;
llSetText page&lt;br /&gt;
which is here&lt;br /&gt;
http://wiki.secondlife.com/wiki/LlSetText&lt;br /&gt;
is missing from page listing all the functions. Can&#039;t quite figure out how that page gets its info, so not going to touch it.&lt;br /&gt;
-- (anonymous and undated) (because not signed with dash dash tilde tilde tilde tilde)&lt;br /&gt;
&lt;br /&gt;
:http://wiki.secondlife.com/w/index.php?title=Category:LSL_Functions&amp;amp;from=PlaySound&lt;br /&gt;
:includes [[llSetText]] nowadays&lt;br /&gt;
:maybe because &amp;quot;LSL Functions&amp;quot; appears in the Categories list at the end nowadays.&lt;br /&gt;
:-- [[User:Ppaatt Lynagh|Ppaatt Lynagh]] 05:57, 2 December 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
== Conspiracy? ==&lt;br /&gt;
&lt;br /&gt;
I whould like to know if &amp;lt;br/&amp;gt;&lt;br /&gt;
a) this is a public wiki, where everybody can contribute so the LSL gets better known, or if it is a private viki with conspirativ charakter&amp;lt;br/&amp;gt;&lt;br /&gt;
b) why it is kept so spartanik with information&amp;lt;br/&amp;gt;&lt;br /&gt;
c) why no lindens who wrote LSL document their work&amp;lt;br/&amp;gt;&lt;br /&gt;
d) why some private persons are called administrators, what rights do they have, and if they have ever signed a paper that makes them not abuse theyr position&amp;lt;br/&amp;gt;&lt;br /&gt;
e) why linden lab employees never fisicaly work and only give &amp;quot;precios advises&amp;quot;&amp;lt;br/&amp;gt;&lt;br /&gt;
dont dare to delete this.&amp;lt;br/&amp;gt;&lt;br /&gt;
{{User|Anylyn Hax}} 04:09, 8 August 2007 (PDT)&lt;br /&gt;
&lt;br /&gt;
:I shall try to answer:&lt;br /&gt;
:a) It is a public wiki but not everyone can contribute, you must have an SL account to contribute.&lt;br /&gt;
:b) No one has added more information.&lt;br /&gt;
:c) They did, it&#039;s in the LSL manual that ships with the client (it&#039;s common knowledge that it sucks).&lt;br /&gt;
:d) I don&#039;t know of any non-linden administrators on the wiki.&lt;br /&gt;
:e) The design of LSL is stable and there are very few LSL bugs that haven&#039;t been vetted; it would surprise me if there were any full time LSL devs. Just because we don&#039;t see them working doesn&#039;t mean they aren&#039;t working; the SL code base is huge.&lt;br /&gt;
:-- [[User:Strife Onizuka|Strife Onizuka]] 12:56, 8 August 2007 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Vehicle Tutorial ==&lt;br /&gt;
&lt;br /&gt;
Could we get the original vehicle tutorial added to this wiki. I realize it&#039;s not in the correct format, but it&#039;s a place to start. There was a wikified version too in the old wiki someone did, but they&#039;d have to contribute it themselves I&#039;d think. I can&#039;t find the original tutorial outside the old wiki.&lt;br /&gt;
&lt;br /&gt;
:The tutorial was part of the LSL manual that ships with the client. LL has given permission to post it on the wiki. -- [[User:Strife Onizuka|Strife Onizuka]] 16:37, 8 September 2007 (PDT)&lt;br /&gt;
&lt;br /&gt;
::I found an old copy I had and wikified it. This is pretty much the original version, so it&#039;s probably a bit whacked, please fix any problems you&#039;re aware of [[User:Ralph Doctorow|Ralph Doctorow]]&lt;br /&gt;
&lt;br /&gt;
== color ==&lt;br /&gt;
&lt;br /&gt;
It would be very helpful if I could use different colored text when writing my articles. Could buttons be added for black text, red text, green text, and one other color of text? Or could someone list the codes that can be used to change text color?&lt;br /&gt;
&lt;br /&gt;
Just as an example of what I intend to use color for:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;black&#039;&#039;rotation &#039;&#039;red&#039;&#039;variable&#039;&#039;black&#039;&#039;=&amp;lt;&#039;&#039;red&#039;&#039;%,%,%,&#039;&#039;green&#039;&#039;#.#&#039;&#039;black&#039;&#039;&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
-- Anonymous, Undated&lt;br /&gt;
&lt;br /&gt;
: The LSL /LSL tags give colour to LSL code, &#039;&#039;e.g.&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;vector up = &amp;lt; 0, 0, 1 &amp;gt;;&amp;lt;/lsl&amp;gt; -- [[User:Ppaatt Lynagh|Ppaatt Lynagh]] 16:20, 3 January 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== LSL tags and automatic linking: some errors noticed ==&lt;br /&gt;
&lt;br /&gt;
I&#039;m not aware of a specific template to edit/update, but I&#039;ve noticed some of auto-linked functions and constants from &amp;lt;nowiki&amp;gt;&amp;lt;lsl&amp;gt;&amp;lt;/lsl&amp;gt;&amp;lt;/nowiki&amp;gt; tags point to incorrect or &#039;bad&#039; (not found) pages. case in point, llSay points to Lsl_LLSay (which will redirect), and PUBLIC_CHANNEL points to a non-existant search page (there is an actual page available, but it doesn&#039;t go there). I&#039;m sure there are other examples of this, but I&#039;m not aware of a way to update it.... &lt;br /&gt;
&lt;br /&gt;
also curious to know if there is any hope of having localized pages (like french) redirect to their language equivalents through these tags at some point (I know it&#039;s not really feasible at the moment)&lt;br /&gt;
-- [[User:Void Singer|Void Singer]] 13:42, 19 February 2008 (PST)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Hacks? ==&lt;br /&gt;
&lt;br /&gt;
Could we please create a hacks page to be linked on the main LSL portal. Similiar to the old LSL wiki of compiling a growing list of well known tricks and tips for scripting.&lt;br /&gt;
&lt;br /&gt;
For example a well known trick, which I use frequently is the use of (List!=[]) instead of llGetListLength. --[[User:Nexii Malthus|Nexii Malthus]] 07:38, 19 May 2008 (PDT)&lt;br /&gt;
&lt;br /&gt;
:I&#039;ve slapped a page together: [[LSL Hacks]]. I&#039;d like comments on the style and layout. Please in the future don&#039;t stand on ceremony, if a niche needs filling, then please fill it with content. I have found that if you wait for people to weigh in before you start then nothing will get done. Better to do your best and make adjustments when there is a stink. -- [[User:Strife Onizuka|Strife Onizuka]] 09:37, 19 May 2008 (PDT)&lt;br /&gt;
&lt;br /&gt;
== LSLwiki.net ==&lt;br /&gt;
&amp;lt;sup&amp;gt;(moved from &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[{{fullurl:Template talk:LSL Function|oldid=110833}} Template talk:LSL Function]&amp;lt;/span&amp;gt;)&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I had a discussion with [[User:Gally Young|Gally]] today and we came to the following conclusion:&amp;lt;br&amp;gt;Since we&#039;re not able to copy content from [http://www.lslwiki.net lslwiki.net] and vice versa - because of licensing problems - we might benefit from linking related articles of both wikis. So users can easily switch from one Wiki to the other and find the information most helpful for them. There shouldn&#039;t be a rivalry between these two documentation projects. They should benefit from each other. Therefor, we&#039;re adding a link to the related LSLwiki.net article to this template. I hope it&#039;s ok.&amp;lt;br&amp;gt;&lt;br /&gt;
Something else on the same topic: It seems to be(come) quite popular in Wiki culture to double-license the own contributions, in order to make them easier to share. Wikis of interest for us:&lt;br /&gt;
* The Second Life Wiki (of course): [http://creativecommons.org/licenses/by-sa/3.0/ Creative Commons Attribution-Share Alike 3.0]&lt;br /&gt;
* The [http://www.lslwiki.net LSLwiki.net]: an [http://lslwiki.net/lslwiki/wakka.php?wakka=LSLwikicopyright implicit copyright model]&lt;br /&gt;
* The [http://secondlife.wikia.com/wiki/Main_Page SecondLife Wikia]: [http://www.gnu.org/copyleft/fdl.html GNU Free Documentation License]&lt;br /&gt;
Please consider to double-license your contributions to this (or other) Wikis in order to make them easier to share, by writing a statemanet about double licensing on your userpage. You can also use one of [[User:SignpostMarv Martin|Marv]]&#039;s templates: [[Template:Re-license contributions]] as well as [[Template:License]].&amp;lt;br&amp;gt;&lt;br /&gt;
This is just a &#039;&#039;suggestion&#039;&#039; of course. Just do it, in case you want to do it.&amp;lt;br&amp;gt;&lt;br /&gt;
Greetz, [[Image:Zai_signature.png|45px]] &#039;&#039;&#039;[[User:Zai Lynch|Lynch]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Zai Lynch|talk]]|[[Special:Contributions/Zai Lynch|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 20:14, 9 September 2008 (PDT)&lt;br /&gt;
&lt;br /&gt;
== LSL Portal should have links to pages that are helpful and often used ==&lt;br /&gt;
&lt;br /&gt;
* The guidelines shown is for editing the LSL portal and not about LSL script it self. Instead it should link to say [[LSL Style Guide]] or just be removed.&lt;br /&gt;
* The same thing with the to do link. I would just remove it.&lt;br /&gt;
* I most often use [[:Category:LSL Functions]]. When I first was looking for information on how to script in LSL this is what I wanted. I think it should be the first link. Looking at [[Special:Statistics]] it is the 5th most viewed page with 708,956 views.&lt;br /&gt;
* Next I think [[LSL Tutorial]] should be added as it is a great place for people who have never scripted before and even for those who work in other languages. This is also the 8th most viewed page on the wiki.&lt;br /&gt;
* The last link I would add [[:Category:LSL_Library]] which is a list of scripts that show off how LSL works or does a common task.&lt;br /&gt;
:* For the the two categories you may want to use [[Template:LSLGC]].&lt;br /&gt;
[[User:Master Starship|Master Starship]] 17:34, 23 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* I take it you haven&#039;t see the [[Template:LSL Header|Header]] at the top of every article in the [[LSL Portal]]. It has all those links you call for. (Those articles didn&#039;t get popular because people used &amp;quot;Search&amp;quot;).&lt;br /&gt;
* The [[LSL Portal Guidelines]] contains not just the rules but the mission statement for the LSL Portal. It is fundamental to the this portals continued existence. Without it we would lack direction, and defined social guidelines. Without defined guidelines we would eventual descend into chaos (I&#039;ve seen it happen; the writing of the guidelines has mostly been in reaction to specific incidents). It needs to be in a prominent position so that editors will find it and read it (or can&#039;t make excuses as to why they haven&#039;t read it).&lt;br /&gt;
* Like the [[LSL Portal Guidelines]], the [[LSL Portal To-do]] link is in a section dedicated to the [[LSL Portal]] as a whole, not to LSL scripting. The rest of the page is dedicated to scripting. It&#039;s a small section.&lt;br /&gt;
-- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 19:14, 23 April 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Proposal About &amp;quot;LSL Categories&amp;quot; Section ==&lt;br /&gt;
&lt;br /&gt;
I find current view is too messing and difficult to find what I need. The users end up looking in huge list of {{LSLGC|Functions}}, clicking much. I am thinking about organizing the list to easily look up the LSL articles.&lt;br /&gt;
&lt;br /&gt;
Here is the proposal of categorizing.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Avatar&lt;br /&gt;
 - Animation&lt;br /&gt;
 - Attachment&lt;br /&gt;
 - Behavior&lt;br /&gt;
 - Camera&lt;br /&gt;
 - Properties&lt;br /&gt;
Land&lt;br /&gt;
 - Parcel&lt;br /&gt;
 - Region&lt;br /&gt;
Object&lt;br /&gt;
 - Detection&lt;br /&gt;
 - Existence&lt;br /&gt;
 - Face&lt;br /&gt;
 - Inventory&lt;br /&gt;
 - Link&lt;br /&gt;
 - Media&lt;br /&gt;
 - Physic&lt;br /&gt;
 - Properties&lt;br /&gt;
 - Text&lt;br /&gt;
Script&lt;br /&gt;
 - Control&lt;br /&gt;
　- Convert&lt;br /&gt;
 - List&lt;br /&gt;
 - Math&lt;br /&gt;
 - Network&lt;br /&gt;
 - String&lt;br /&gt;
 - Time&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I tried to sort all existing 339 functions (except God, not active one).&lt;br /&gt;
Here is the list ---&amp;gt; [[User:Mako_Nozaki/Category_Function]]&lt;br /&gt;
&lt;br /&gt;
My thought is, current categories will remain as is and will be used as &amp;quot;tags&amp;quot;. Missing categories will be added and be linked from each functions. Adding these categories to LSL Header using Javascript (pulldown menu) might be cool. --[[User:Mako Nozaki|Mako]] 12:56, 1 May 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== User-Defined Functions ==&lt;br /&gt;
&lt;br /&gt;
I&#039;m personally adverse to linking to the template description rather than the category (which already back links to the template) in the &amp;quot;language reference&amp;quot; section, as per the [[https://wiki.secondlife.com/w/index.php?title=LSL_Portal&amp;amp;diff=0&amp;amp;oldid=1158048|most recent edit]]. but since it&#039;s obvious someone else is not I thought I&#039;d solicit thoughts before reverting it. I&#039;m thinking it could be more clear on the category page though.&amp;lt;br/&amp;gt;-- &#039;&#039;&#039;[[User:Void_Singer|Void]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 22:49, 10 May 2012 (PDT)&lt;br /&gt;
&lt;br /&gt;
:I agree with you. In addition to that, I think the two articles should be merged. We gain nothing of value by having them separate. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 10:37, 11 May 2012 (PDT)&lt;br /&gt;
&lt;br /&gt;
::Pointed the link back at the category, folded the article into the category page, and marked the original article page for deletion.&amp;lt;br/&amp;gt;-- &#039;&#039;&#039;[[User:Void_Singer|Void]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User_talk:Void_Singer|talk]]|[[Special:Contributions/Void_Singer|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 10:45, 1 June 2012 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Categories ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s probably time to update the category list and tree again. It&#039;s been a while and I&#039;m sure I&#039;ve added more since the last time we update them. Also I should remember to update the LSL News box. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 10:42, 11 May 2012 (PDT)&lt;br /&gt;
:There are extensions that can update the category list automagically like [https://www.mediawiki.org/wiki/Extension:DynamicPageList_(Wikimedia) Extension:DynamicPageList]. I am not sure one is installed here. Would we have to wait for a Linden to set something up like this? — [[User:Kizmut Smit|kizmut]]&amp;lt;span style=&amp;quot;letter-spacing: -2px&amp;quot;&amp;gt;&amp;lt;sup&amp;gt;[[User Talk:Kizmut Smit|T]]&amp;lt;/sup&amp;gt;/&amp;lt;sub&amp;gt;[[Special:Contributions/Kizmut Smit|C]]&amp;lt;/sub&amp;gt;&amp;lt;/span&amp;gt; 12:18, 14 June 2012 (PDT)&lt;br /&gt;
::It really has to be done manually, some categories are intentionally excluded and it&#039;s not a pure tree (I think there may even be loops). -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 21:00, 14 June 2012 (PDT)&lt;br /&gt;
:::If the category list on LSL portal top page is shorter, I think it will be more navigable. I have once considered the new list few years ago (you can see it above). Both tag (as wiki category) and hierarchical access may be needed to easily find what they want to know. -- [[User:Mako Nozaki|Mako]] 03:47, 15 June 2012 (PDT)&lt;br /&gt;
&lt;br /&gt;
We&#039;ve had several new categories in the last year. Wouldn&#039;t be a bad time to update. I wonder if there is some good way of indexing them. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 23:16, 7 July 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Recent Formatting Edits == &lt;br /&gt;
prettying up the alphabetical Functions links as they were (formatted now for consistency as bulletted links) brought up a deficiency in the original manner in how the links Should work. towit A-L should find an Anchor ID in the target page&#039;s listed functions to scroll the browser to, same as L-V (i suppose at the L functions), T-Z (at the T). i can&#039;t edit the subsequent target page Category:LSL Functions so the actual listing shows more than what it actually performs. each alpha category jumps the browser to the top of the page. if anyone can access the Category:LSL Functions page could they put some Anchor ID tags at the demarked alphabetical links? &lt;br /&gt;
-- [[User:EnCore_Mayne|EnCore Mayne]] 21:55, 7 September 2012 (PDT)&lt;br /&gt;
&lt;br /&gt;
:I added an anchor at the end of the content but it looks better to use the one supplied with &#039;&#039;Pages in category &amp;quot;LSL Functions&amp;quot;&#039;&#039;. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 07:50, 8 September 2012 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Articles in need of version number ==&lt;br /&gt;
&lt;br /&gt;
I&#039;ve gotten sick of seeing the [[:Category:Articles in need of version number/LSL|Articles in need of version number/LSL]] category link, so I&#039;ve modified Multi-lang to support disabling of versioning (which will require a wiki-god to approve the edit), and I&#039;ve hidden the category for the mean time. Versioning is a underused feature and we don&#039;t use it. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 23:10, 7 July 2013 (PDT)&lt;br /&gt;
&lt;br /&gt;
== Tiny font in script samples ==&lt;br /&gt;
Since 22 January 2015, I&#039;ve noticed the text of code snippets has shrank, reducing readability. Upon further inspection of recent changes, I learned that all instances were the result of the &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;&amp;lt;lsl&amp;gt;&amp;lt;/lsl&amp;gt;&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; tags being replaced with &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;. The Caveats list sections of several pages have also become vertically misaligned. Whatever benefits the change from &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;&amp;lt;lsl&amp;gt;&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; to &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; brings, I doubt they are worth having to squint at. Isn&#039;t readable text a must on a nearly pure text site? I can only imagine how it will appear for users with 1080p+ resolution monitors. Unless lsl2 brings critical features or is mandatory, I propose the change be reverted for easier reading. -- [[User:Sharpe Clowes|Sharpe Clowes]] ([[User talk:Sharpe Clowes|talk]]) 19:29, 30 January 2015 (PST)&lt;br /&gt;
: Yep, the tag change was required by a move from an old extension to a current one. I&#039;m not seeing big font changes or caveat misalignment here, what browser are you on? --[[User:Cerise Sorbet|Cerise Sorbet]] ([[User talk:Cerise Sorbet|talk]]) 21:54, 30 January 2015 (PST)&lt;br /&gt;
:: OK, going to guess that you&#039;re using Firefox? The current CSS yields to the user&#039;s browser preference for the monospace font, and Firefox defaults to a tiny 13 points for that. --[[User:Cerise Sorbet|Cerise Sorbet]] ([[User talk:Cerise Sorbet|talk]]) 00:14, 31 January 2015 (PST)&lt;br /&gt;
::: &amp;lt;div&amp;gt;It&#039;s happening to me too in Iceweasel (Firefox). The culprit seems to be this line from the geshi stylesheet:&amp;lt;pre&amp;gt;.lsl2.source-lsl2 .de1, .lsl2.source-lsl2 .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;font-family: monospace, monospace;}&amp;lt;/pre&amp;gt;specifically the &amp;lt;code&amp;gt;1em&amp;lt;/code&amp;gt; part. Removing it gets the font back to the &amp;lt;nowiki&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;/nowiki&amp;gt; font default height which is 12px and makes it work decently. --[[User:Pedro Oval|Pedro Oval]] ([[User talk:Pedro Oval|talk]]) 08:58, 31 January 2015 (PST)&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Talk:Internal_Animations&amp;diff=1195146</id>
		<title>Talk:Internal Animations</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Talk:Internal_Animations&amp;diff=1195146"/>
		<updated>2015-01-25T16:06:07Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: /* Animation embarrassed */ Explain why&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I have not figured out how to get the priority levels for the animations.  If someone knows how, please update this list.  Descriptions would help as well. [[User:Fennec Wind|Fennec Wind]]&lt;br /&gt;
&lt;br /&gt;
:The priorities for the built in animations are complicated, each bone has it&#039;s own priority. [[User:Strife Onizuka|Strife Onizuka]] 20:42, 4 March 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
::Well, that&#039;s good to know. Another answer is this: press Ctrl-Alt-Shift-D to enable the debug menu and go to Client -&amp;gt; Characters -&amp;gt; Animation Info. This will display the animation name and priority above an avatar&#039;s head (or an agent&#039;s bounding box, or whatever.) It also shows that some animations (sometimes) automatically play other animations. Like playing express_afraid, listed as priority 2, also triggers express_afraid_emote, priority 1. But back to your statement -- is there an easier way to figure out which bones are affected besides having five whole-body animations of P0-4 and playing each animation over them to see which bones get moved? --[[User:Stickman Ingmann|Stickman Ingmann]] 16:19, 10 December 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
:::I&#039;ve got an animation decompiler somewhere, I may also have the default priorities on file somewhere too. I&#039;m a bit busy at the moment but I&#039;ll look into digging it out later. -- [[User:Strife Onizuka|Strife Onizuka]] 01:05, 11 December 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
Ok, that makes sense, I guess I should just remove the column then.  Thanks for putting this in the comments section, I&#039;m not used to this wiki software yet. [[User:Fennec Wind|Fennec Wind]] 02:25, 5 March 2007 (PST)&lt;br /&gt;
&lt;br /&gt;
== Animation embarrassed ==&lt;br /&gt;
&lt;br /&gt;
It looks like express_embarrassed / express_embarrased_emote does not work for   me.&lt;br /&gt;
There is however a gesture which plays ani:Embarrassed  - [[User:Bernd Elswit|Bernd Elswit]] 18:51, 30 April 2007 (PDT)&lt;br /&gt;
&lt;br /&gt;
: The spellings are the other way around: express_embarrased (single &#039;s&#039;) and express_embarrassed_emote (double &#039;s&#039;). --[[User:Pedro Oval|Pedro Oval]] ([[User talk:Pedro Oval|talk]]) 08:06, 25 January 2015 (PST)&lt;br /&gt;
&lt;br /&gt;
== Voice Chat ==&lt;br /&gt;
As far as I&#039;ve been informed by random passerbys, there are three animations for voice chat. One is UUID 37694185-3107-d418-3a20-0181424e542d, which seems to be the &amp;quot;mid volume&amp;quot; voice. This and the other two (and how they work) should be added to this page if someone has time. --[[User:Stickman Ingmann|Stickman]] 21:53, 1 January 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
They&#039;re also not available in the .bvh download pack, which makes them pretty illusive. (I needed them to re-upload as a higher priority.) :( [[User:Adeon Writer|Adeon Writer]] 18:08, 12 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Alright, after a bit of digging I found a list of 19 animation UUID&#039;s related to Speech Gestures. that&#039;s 3 more than the amount of speech gestures (16) which means 3 of them are actually the animations. Which 3? I don&#039;t know! The others are communicating volume levels.&lt;br /&gt;
&lt;br /&gt;
list voice = [&lt;br /&gt;
&amp;quot;8cd77049-0670-e0ad-85cd-d12fdd7a33f3&amp;quot;,&lt;br /&gt;
&amp;quot;3557510a-5eb4-d0ce-0b91-67c72aa75312&amp;quot;,&lt;br /&gt;
&amp;quot;2b78c24a-2451-6135-fc49-ad274552bb68&amp;quot;,&lt;br /&gt;
&amp;quot;0f645c60-3151-2805-b6f7-28e710ed22ac&amp;quot;,&lt;br /&gt;
&amp;quot;9a7f3201-7bbd-4f75-b762-24270536e4e3&amp;quot;,&lt;br /&gt;
&amp;quot;68db359f-4c9c-0932-5f1e-e95e3a0b19bc&amp;quot;,&lt;br /&gt;
&amp;quot;7ef0d5c0-3346-06e4-5cfc-f081db108baa&amp;quot;,&lt;br /&gt;
&amp;quot;37694185-3107-d418-3a20-0181424e542d&amp;quot;,&lt;br /&gt;
&amp;quot;cb1139b6-e7c3-fdc7-a9c1-e21673d7a50e&amp;quot;,&lt;br /&gt;
&amp;quot;28a3f544-268d-da71-7da6-82c8dd522cb9&amp;quot;,&lt;br /&gt;
&amp;quot;cc340155-3e9d-60fe-d8e3-9e9abc7062d1&amp;quot;,&lt;br /&gt;
&amp;quot;bbf194d1-a118-1312-998b-8145cec6eaff&amp;quot;,&lt;br /&gt;
&amp;quot;a71890f1-0dab-8744-fd47-7defaf411dbf&amp;quot;,&lt;br /&gt;
&amp;quot;593e9a3d-58d8-c594-d6dd-f4b98965202e&amp;quot;,&lt;br /&gt;
&amp;quot;55fe6788-8a16-d998-2f63-3c1eab2b6009&amp;quot;,&lt;br /&gt;
&amp;quot;c1802201-5f4e-366f-7f78-2d08ec6ea54a&amp;quot;,&lt;br /&gt;
&amp;quot;69d5a8ed-9ec6-6dac-842f-d92d82e69428&amp;quot;,&lt;br /&gt;
&amp;quot;c541c47f-e0c0-058b-ad1a-d6ae3a4584d9&amp;quot;,&lt;br /&gt;
&amp;quot;951070f8-00fc-d3bd-813d-bd2922464246&amp;quot;];&lt;br /&gt;
&lt;br /&gt;
Good luck! [[User:Adeon Writer|Adeon Writer]] 18:34, 12 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== BVH files location ==&lt;br /&gt;
Yay! the file is back. Thanks Cerise&lt;br /&gt;
[[User:Darien Caldwell|Darien Caldwell]] 01:36, 13 January 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
:: The original location was http://s3.amazonaws.com/static-secondlife-com/downloads/avatar/bvh_files.zip and it is still active, this page is updated to use it. --[[User:Cerise Resident|Cerise Resident]] 02:41, 13 January 2011 (UTC)&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Internal_Animations&amp;diff=1195145</id>
		<title>Internal Animations</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Internal_Animations&amp;diff=1195145"/>
		<updated>2015-01-25T16:04:38Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: /* User-playable animations */ Fix spelling to match the actual ones (express_embarrased BUT ALSO express_embarrassed_emote) - note the double &amp;#039;s&amp;#039;)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL Header|ml=*}}&lt;br /&gt;
This is a complete listing of the [[Animation|animations]] built into Second Life.  The name and UUID information was extracted from the Second Life client source code([ Your directory where is the sources of SecondLife]\indra\llcharacter\llanimationstates.cpp, llanimationstates.h and  from the Second Life client installation folder &amp;lt;strike&amp;gt;viewerart.ini&amp;lt;/strike&amp;gt; [ Your directory where is installed SecondLife]\app_settings\viewerart.xml) with some missing file names filled in from in-world testing.  It should be complete as of January 2013. Looped animations are those that need to be explicitly stopped. &lt;br /&gt;
__TOC__&lt;br /&gt;
==About Animation Priority==&lt;br /&gt;
Priorities reported are those from the viewer version 1.19.1.4 (but they haven&#039;t changed in several years), and are the animation&#039;s global priority. Animations also have priorities for each bone in the animation, which will override the animation&#039;s global priority for that bone. When uploading an animations there is no interface to set individual bone priorities; they default to the animations global priority (which is configurable).&lt;br /&gt;
&lt;br /&gt;
==User-playable animations==&lt;br /&gt;
These animations can be triggered by the simulator, viewer, or scripts. Corresponding [[BVH]] files may be downloaded from [http://static-secondlife-com.s3.amazonaws.com/downloads/avatar/bvh_files.zip here] (ZIP format, 926k), you may also want [http://static-secondlife-com.s3.amazonaws.com/downloads/avatar/avatar_mesh.zip .obj files for the SL avatar mesh].&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; {{prettytable}}&lt;br /&gt;
|-{{Hl2}}&lt;br /&gt;
!Animation Name&lt;br /&gt;
![[UUID]]&lt;br /&gt;
!Filename&lt;br /&gt;
!Priority&lt;br /&gt;
!Looped&lt;br /&gt;
!Description&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_AFRAID --&amp;gt;&lt;br /&gt;
|express_afraid&lt;br /&gt;
|6b61c8e8-4747-0d75-12d7-e49ff207a4ca&lt;br /&gt;
|avatar_express_afraid.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_afraid_emote&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_AIM_BAZOOKA_R --&amp;gt;&lt;br /&gt;
|aim_r_bazooka&lt;br /&gt;
|b5b4a67d-0aee-30d2-72cd-77b333e932ef&lt;br /&gt;
|avatar_aim_r_bazooka.bvh&lt;br /&gt;
|2&lt;br /&gt;
|Yes&lt;br /&gt;
|Also triggers targeting&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_AIM_BOW_L --&amp;gt;&lt;br /&gt;
|aim_l_bow&lt;br /&gt;
|46bb4359-de38-4ed8-6a22-f1f52fe8f506&lt;br /&gt;
|avatar_aim_l_bow.bvh&lt;br /&gt;
|2&lt;br /&gt;
|Yes&lt;br /&gt;
|Also triggers targeting&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_AIM_HANDGUN_R --&amp;gt;&lt;br /&gt;
|aim_r_handgun&lt;br /&gt;
|3147d815-6338-b932-f011-16b56d9ac18b&lt;br /&gt;
|avatar_aim_r_handgun.bvh&lt;br /&gt;
|2&lt;br /&gt;
|Yes&lt;br /&gt;
|Also triggers targeting&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_AIM_RIFLE_R --&amp;gt;&lt;br /&gt;
|aim_r_rifle&lt;br /&gt;
|ea633413-8006-180a-c3ba-96dd1d756720&lt;br /&gt;
|avatar_aim_r_rifle.bvh&lt;br /&gt;
|2&lt;br /&gt;
|Yes&lt;br /&gt;
|Also triggers targeting&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_ANGRY --&amp;gt;&lt;br /&gt;
|express_anger&lt;br /&gt;
|5747a48e-073e-c331-f6f3-7c2149613d3e&lt;br /&gt;
|avatar_express_anger.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_anger_emote&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_AWAY --&amp;gt;&lt;br /&gt;
|away&lt;br /&gt;
|fd037134-85d4-f241-72c6-4f42164fedee&lt;br /&gt;
|avatar_away.bvh&lt;br /&gt;
|2&lt;br /&gt;
|Yes&lt;br /&gt;
|Places avatar in Away mode.&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_BACKFLIP --&amp;gt;&lt;br /&gt;
|backflip&lt;br /&gt;
|c4ca6188-9127-4f31-0158-23c4e2f93304&lt;br /&gt;
|avatar_backflip.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_laugh_emote&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_BELLY_LAUGH --&amp;gt;&lt;br /&gt;
|express_laugh&lt;br /&gt;
|18b3a4b5-b463-bd48-e4b6-71eaac76c515&lt;br /&gt;
|avatar_express_laugh.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_laugh_emote&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_BLOW_KISS --&amp;gt;&lt;br /&gt;
|blowkiss&lt;br /&gt;
|db84829b-462c-ee83-1e27-9bbee66bd624&lt;br /&gt;
|avatar_blowkiss.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_kiss&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_BORED --&amp;gt;&lt;br /&gt;
|express_bored&lt;br /&gt;
|b906c4ba-703b-1940-32a3-0c7f7d791510&lt;br /&gt;
|avatar_express_bored.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_bored_emote&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_BOW --&amp;gt;&lt;br /&gt;
|bow&lt;br /&gt;
|82e99230-c906-1403-4d9c-3889dd98daba&lt;br /&gt;
|avatar_bow.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_BRUSH --&amp;gt;&lt;br /&gt;
|brush&lt;br /&gt;
|349a3801-54f9-bf2c-3bd0-1ac89772af01&lt;br /&gt;
|avatar_brush.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_BUSY --&amp;gt;&lt;br /&gt;
|busy&lt;br /&gt;
|efcf670c-2d18-8128-973a-034ebc806b67&lt;br /&gt;
|&lt;br /&gt;
|2&lt;br /&gt;
|Yes&lt;br /&gt;
|No actual animation. Causes [[llGetAgentInfo]] to return [[AGENT_BUSY]] and adds &amp;quot;(Busy)&amp;quot; to avatar&#039;s title. Triggered by the viewer&#039;s busy mode, but does not fully set that mode by itself.&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_CLAP --&amp;gt;&lt;br /&gt;
|clap&lt;br /&gt;
|9b0c1c4e-8ac7-7969-1494-28c874c4f668&lt;br /&gt;
|avatar_clap.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_toothsmile&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_COURTBOW --&amp;gt;&lt;br /&gt;
|courtbow&lt;br /&gt;
|9ba1c942-08be-e43a-fb29-16ad440efc50&lt;br /&gt;
|avatar_courtbow.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_CROUCH --&amp;gt;&lt;br /&gt;
|crouch&lt;br /&gt;
|201f3fdf-cb1f-dbec-201f-7333e328ae7c&lt;br /&gt;
|avatar_crouch.bvh&lt;br /&gt;
|0&lt;br /&gt;
|Yes&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_CROUCHWALK --&amp;gt;&lt;br /&gt;
|crouchwalk&lt;br /&gt;
|47f5f6fb-22e5-ae44-f871-73aaaf4a6022&lt;br /&gt;
|avatar_crouchwalk.bvh&lt;br /&gt;
|0&lt;br /&gt;
|Yes&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_CRY --&amp;gt;&lt;br /&gt;
|express_cry&lt;br /&gt;
|92624d3e-1068-f1aa-a5ec-8244585193ed&lt;br /&gt;
|avatar_express_cry.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_cry_emote&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_CUSTOMIZE --&amp;gt;&lt;br /&gt;
|turn_180&lt;br /&gt;
|038fcec9-5ebd-8a8e-0e2e-6e71a0a1ac53&lt;br /&gt;
|avatar_turn_180.bvh&lt;br /&gt;
|5&lt;br /&gt;
|Yes&lt;br /&gt;
|Adds &amp;quot;(Editing Appearance)&amp;quot; to avatar&#039;s title &lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_CUSTOMIZE_DONE --&amp;gt;&lt;br /&gt;
|turnback_180&lt;br /&gt;
|6883a61a-b27b-5914-a61e-dda118a9ee2c&lt;br /&gt;
|avatar_turnback_180.bvh&lt;br /&gt;
|3&lt;br /&gt;
|No&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_DANCE1 --&amp;gt;&lt;br /&gt;
|dance1&lt;br /&gt;
|b68a3d7c-de9e-fc87-eec8-543d787e5b0d&lt;br /&gt;
|avatar_dance1.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_DANCE2 --&amp;gt;&lt;br /&gt;
|dance2&lt;br /&gt;
|928cae18-e31d-76fd-9cc9-2f55160ff818&lt;br /&gt;
|avatar_dance2.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_DANCE3 --&amp;gt;&lt;br /&gt;
|dance3&lt;br /&gt;
|30047778-10ea-1af7-6881-4db7a3a5a114&lt;br /&gt;
|avatar_dance3.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_DANCE4 --&amp;gt;&lt;br /&gt;
|dance4&lt;br /&gt;
|951469f4-c7b2-c818-9dee-ad7eea8c30b7&lt;br /&gt;
|avatar_dance4.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_DANCE5 --&amp;gt;&lt;br /&gt;
|dance5&lt;br /&gt;
|4bd69a1d-1114-a0b4-625f-84e0a5237155&lt;br /&gt;
|avatar_dance5.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_DANCE6 --&amp;gt;&lt;br /&gt;
|dance6&lt;br /&gt;
|cd28b69b-9c95-bb78-3f94-8d605ff1bb12&lt;br /&gt;
|avatar_dance6.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_DANCE7 --&amp;gt;&lt;br /&gt;
|dance7&lt;br /&gt;
|a54d8ee2-28bb-80a9-7f0c-7afbbe24a5d6&lt;br /&gt;
|avatar_dance7.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_DANCE8 --&amp;gt;&lt;br /&gt;
|dance8&lt;br /&gt;
|b0dc417c-1f11-af36-2e80-7e7489fa7cdc&lt;br /&gt;
|avatar_dance8.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_DEAD --&amp;gt;&lt;br /&gt;
|dead&lt;br /&gt;
|57abaae6-1d17-7b1b-5f98-6d11a6411276&lt;br /&gt;
|avatar_dead.bvh&lt;br /&gt;
|4&lt;br /&gt;
|Yes&lt;br /&gt;
|Also triggers express_surprise_emote&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_DRINK --&amp;gt;&lt;br /&gt;
|drink&lt;br /&gt;
|0f86e355-dd31-a61c-fdb0-3a96b9aad05f&lt;br /&gt;
|avatar_drink.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_laugh_emote&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_EMBARRASSED --&amp;gt;&lt;br /&gt;
|express_embarrased&lt;br /&gt;
|514af488-9051-044a-b3fc-d4dbf76377c6&lt;br /&gt;
|avatar_express_embarrased.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_embarrassed_emote&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_EXPRESS_AFRAID --&amp;gt;&lt;br /&gt;
|express_afraid_emote&lt;br /&gt;
|aa2df84d-cf8f-7218-527b-424a52de766e&lt;br /&gt;
|avatar_express_afraid_emote.bvh&lt;br /&gt;
|1&lt;br /&gt;
|No&lt;br /&gt;
|Facial expression&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_EXPRESS_ANGER --&amp;gt;&lt;br /&gt;
|express_anger_emote&lt;br /&gt;
|1a03b575-9634-b62a-5767-3a679e81f4de&lt;br /&gt;
|avatar_express_anger_emote.bvh&lt;br /&gt;
|1&lt;br /&gt;
|No&lt;br /&gt;
|Facial expression&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_EXPRESS_BORED --&amp;gt;&lt;br /&gt;
|express_bored_emote&lt;br /&gt;
|214aa6c1-ba6a-4578-f27c-ce7688f61d0d&lt;br /&gt;
|avatar_express_bored_emote.bvh&lt;br /&gt;
|1&lt;br /&gt;
|No&lt;br /&gt;
|Facial expression&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_EXPRESS_CRY --&amp;gt;&lt;br /&gt;
|express_cry_emote&lt;br /&gt;
|d535471b-85bf-3b4d-a542-93bea4f59d33&lt;br /&gt;
|avatar_express_cry_emote.bvh&lt;br /&gt;
|1&lt;br /&gt;
|No&lt;br /&gt;
|Facial expression&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_EXPRESS_DISDAIN --&amp;gt;&lt;br /&gt;
|express_disdain&lt;br /&gt;
|d4416ff1-09d3-300f-4183-1b68a19b9fc1&lt;br /&gt;
|avatar_express_disdain_emote.bvh&lt;br /&gt;
|1&lt;br /&gt;
|No&lt;br /&gt;
|Facial expression&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_EXPRESS_EMBARRASSED --&amp;gt;&lt;br /&gt;
|express_embarrassed_emote&lt;br /&gt;
|0b8c8211-d78c-33e8-fa28-c51a9594e424&lt;br /&gt;
|avatar_express_embarrassed_emote.bvh&lt;br /&gt;
|1&lt;br /&gt;
|No&lt;br /&gt;
|Facial expression&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_EXPRESS_FROWN --&amp;gt;&lt;br /&gt;
|express_frown&lt;br /&gt;
|fee3df48-fa3d-1015-1e26-a205810e3001&lt;br /&gt;
|avatar_express_frown.bvh&lt;br /&gt;
|1&lt;br /&gt;
|No&lt;br /&gt;
|Facial expression&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_EXPRESS_KISS --&amp;gt;&lt;br /&gt;
|express_kiss&lt;br /&gt;
|1e8d90cc-a84e-e135-884c-7c82c8b03a14&lt;br /&gt;
|avatar_express_kiss.bvh&lt;br /&gt;
|1&lt;br /&gt;
|No&lt;br /&gt;
|Facial expression&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_EXPRESS_LAUGH --&amp;gt;&lt;br /&gt;
|express_laugh_emote&lt;br /&gt;
|62570842-0950-96f8-341c-809e65110823&lt;br /&gt;
|avatar_express_laugh_emote.bvh&lt;br /&gt;
|1&lt;br /&gt;
|No&lt;br /&gt;
|Facial expression&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_EXPRESS_OPEN_MOUTH --&amp;gt;&lt;br /&gt;
|express_open_mouth&lt;br /&gt;
|d63bc1f9-fc81-9625-a0c6-007176d82eb7&lt;br /&gt;
|avatar_express_open_mouth.bvh&lt;br /&gt;
|1&lt;br /&gt;
|No&lt;br /&gt;
|Facial expression&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_EXPRESS_REPULSED --&amp;gt;&lt;br /&gt;
|express_repulsed_emote&lt;br /&gt;
|f76cda94-41d4-a229-2872-e0296e58afe1&lt;br /&gt;
|avatar_express_repulsed_emote.bvh&lt;br /&gt;
|1&lt;br /&gt;
|No&lt;br /&gt;
|Facial expression&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_EXPRESS_SAD --&amp;gt;&lt;br /&gt;
|express_sad_emote&lt;br /&gt;
|eb6ebfb2-a4b3-a19c-d388-4dd5c03823f7&lt;br /&gt;
|avatar_express_sad_emote.bvh&lt;br /&gt;
|1&lt;br /&gt;
|No&lt;br /&gt;
|Facial expression&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_EXPRESS_SHRUG --&amp;gt;&lt;br /&gt;
|express_shrug_emote&lt;br /&gt;
|a351b1bc-cc94-aac2-7bea-a7e6ebad15ef&lt;br /&gt;
|avatar_express_shrug_emote.bvh&lt;br /&gt;
|1&lt;br /&gt;
|No&lt;br /&gt;
|Facial expression&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_EXPRESS_SMILE --&amp;gt;&lt;br /&gt;
|express_smile&lt;br /&gt;
|b7c7c833-e3d3-c4e3-9fc0-131237446312&lt;br /&gt;
|avatar_express_smile.bvh&lt;br /&gt;
|1&lt;br /&gt;
|No&lt;br /&gt;
|Facial expression&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_EXPRESS_SURPRISE --&amp;gt;&lt;br /&gt;
|express_surprise_emote&lt;br /&gt;
|728646d9-cc79-08b2-32d6-937f0a835c24&lt;br /&gt;
|avatar_express_surprise.bvh&lt;br /&gt;
|1&lt;br /&gt;
|No&lt;br /&gt;
|Facial expression&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_EXPRESS_TONGUE_OUT --&amp;gt;&lt;br /&gt;
|express_tongue_out&lt;br /&gt;
|835965c6-7f2f-bda2-5deb-2478737f91bf&lt;br /&gt;
|avatar_express_tongue_out.bvh&lt;br /&gt;
|1&lt;br /&gt;
|No&lt;br /&gt;
|Facial expression&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_EXPRESS_TOOTHSMILE --&amp;gt;&lt;br /&gt;
|express_toothsmile&lt;br /&gt;
|b92ec1a5-e7ce-a76b-2b05-bcdb9311417e&lt;br /&gt;
|avatar_express_toothsmile.bvh&lt;br /&gt;
|1&lt;br /&gt;
|No&lt;br /&gt;
|Facial expression&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_EXPRESS_WINK --&amp;gt;&lt;br /&gt;
|express_wink_emote&lt;br /&gt;
|da020525-4d94-59d6-23d7-81fdebf33148&lt;br /&gt;
|avatar_express_wink_emote.bvh&lt;br /&gt;
|1&lt;br /&gt;
|No&lt;br /&gt;
|Facial expression&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_EXPRESS_WORRY --&amp;gt;&lt;br /&gt;
|express_worry_emote&lt;br /&gt;
|9c05e5c7-6f07-6ca4-ed5a-b230390c3950&lt;br /&gt;
|avatar_express_worry_emote.bvh&lt;br /&gt;
|1&lt;br /&gt;
|No&lt;br /&gt;
|Facial expression&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_FALLDOWN --&amp;gt;&lt;br /&gt;
|falldown&lt;br /&gt;
|666307d9-a860-572d-6fd4-c3ab8865c094&lt;br /&gt;
|avatar_falldown.bvh&lt;br /&gt;
|3&lt;br /&gt;
|Yes&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_FEMALE_WALK --&amp;gt;&lt;br /&gt;
|female_walk&lt;br /&gt;
|f5fc7433-043d-e819-8298-f519a119b688&lt;br /&gt;
|avatar_female_walk.bvh&lt;br /&gt;
|3 &amp;amp; 0&lt;br /&gt;
|Yes&lt;br /&gt;
|(priority 3 for pelvis and legs, 0 for everything else)&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_FINGER_WAG --&amp;gt;&lt;br /&gt;
|angry_fingerwag&lt;br /&gt;
|c1bc7f36-3ba0-d844-f93c-93be945d644f&lt;br /&gt;
|avatar_angry_fingerwag.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_frown&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_FIST_PUMP --&amp;gt;&lt;br /&gt;
|fist_pump&lt;br /&gt;
|7db00ccd-f380-f3ee-439d-61968ec69c8a&lt;br /&gt;
|avatar_fist_pump.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_toothsmile&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_FLY --&amp;gt;&lt;br /&gt;
|fly&lt;br /&gt;
|aec4610c-757f-bc4e-c092-c6e9caf18daf&lt;br /&gt;
|avatar_fly.bvh&lt;br /&gt;
|0&lt;br /&gt;
|Yes&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_FLYSLOW --&amp;gt;&lt;br /&gt;
|flyslow&lt;br /&gt;
|2b5a38b2-5e00-3a97-a495-4c826bc443e6&lt;br /&gt;
|avatar_flyslow.bvh&lt;br /&gt;
|0&lt;br /&gt;
|Yes&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_HELLO --&amp;gt;&lt;br /&gt;
|hello&lt;br /&gt;
|9b29cd61-c45b-5689-ded2-91756b8d76a9&lt;br /&gt;
|avatar_hello.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_toothsmile&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_HOLD_BAZOOKA_R --&amp;gt;&lt;br /&gt;
|hold_r_bazooka&lt;br /&gt;
|ef62d355-c815-4816-2474-b1acc21094a6&lt;br /&gt;
|avatar_hold_r_bazooka.bvh&lt;br /&gt;
|2&lt;br /&gt;
|Yes&lt;br /&gt;
|Automatically replaced by aim_r_bazooka in [[mouselook]]&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_HOLD_BOW_L --&amp;gt;&lt;br /&gt;
|hold_l_bow&lt;br /&gt;
|8b102617-bcba-037b-86c1-b76219f90c88&lt;br /&gt;
|avatar_hold_l_bow.bvh&lt;br /&gt;
|2&lt;br /&gt;
|Yes&lt;br /&gt;
|Automatically replaced by aim_l_bow in [[mouselook]]&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_HOLD_HANDGUN_R --&amp;gt;&lt;br /&gt;
|hold_r_handgun&lt;br /&gt;
|efdc1727-8b8a-c800-4077-975fc27ee2f2&lt;br /&gt;
|avatar_hold_r_handgun.bvh&lt;br /&gt;
|2&lt;br /&gt;
|Yes&lt;br /&gt;
|Automatically replaced by aim_r_handgun in [[mouselook]]&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_HOLD_RIFLE_R --&amp;gt;&lt;br /&gt;
|hold_r_rifle&lt;br /&gt;
|3d94bad0-c55b-7dcc-8763-033c59405d33&lt;br /&gt;
|avatar_hold_r_rifle.bvh&lt;br /&gt;
|2&lt;br /&gt;
|Yes&lt;br /&gt;
|Automatically replaced by aim_r_rifle in [[mouselook]]&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_HOLD_THROW_R --&amp;gt;&lt;br /&gt;
|hold_throw_r&lt;br /&gt;
|7570c7b5-1f22-56dd-56ef-a9168241bbb6&lt;br /&gt;
|avatar_hold_throw_r.bvh&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|(Missing as of 2008-06-12)&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_HOVER --&amp;gt;&lt;br /&gt;
|hover&lt;br /&gt;
|4ae8016b-31b9-03bb-c401-b1ea941db41d&lt;br /&gt;
|avatar_hover.bvh&lt;br /&gt;
|0&lt;br /&gt;
|Yes&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_HOVER_DOWN --&amp;gt;&lt;br /&gt;
|hover_down&lt;br /&gt;
|20f063ea-8306-2562-0b07-5c853b37b31e&lt;br /&gt;
|avatar_hover_down.bvh&lt;br /&gt;
|0&lt;br /&gt;
|Yes&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_HOVER_UP --&amp;gt;&lt;br /&gt;
|hover_up&lt;br /&gt;
|62c5de58-cb33-5743-3d07-9e4cd4352864&lt;br /&gt;
|avatar_hover_up.bvh&lt;br /&gt;
|0&lt;br /&gt;
|Yes&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_IMPATIENT --&amp;gt;&lt;br /&gt;
|impatient&lt;br /&gt;
|5ea3991f-c293-392e-6860-91dfa01278a3&lt;br /&gt;
|avatar_impatient.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_frown&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_JUMP --&amp;gt;&lt;br /&gt;
|jump&lt;br /&gt;
|2305bd75-1ca9-b03b-1faa-b176b8a8c49e&lt;br /&gt;
|avatar_jump.bvh&lt;br /&gt;
|0&lt;br /&gt;
|Yes&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_JUMP_FOR_JOY --&amp;gt;&lt;br /&gt;
|jumpforjoy&lt;br /&gt;
|709ea28e-1573-c023-8bf8-520c8bc637fa&lt;br /&gt;
|avatar_jumpforjoy.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_laugh_emote&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_KISS_MY_BUTT --&amp;gt;&lt;br /&gt;
|kissmybutt&lt;br /&gt;
|19999406-3a3a-d58c-a2ac-d72e555dcf51&lt;br /&gt;
|avatar_kissmybutt.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_kiss&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_LAND --&amp;gt;&lt;br /&gt;
|land&lt;br /&gt;
|7a17b059-12b2-41b1-570a-186368b6aa6f&lt;br /&gt;
|avatar_land.bvh&lt;br /&gt;
|0&lt;br /&gt;
|Yes&lt;br /&gt;
|Stopped automatically by viewer&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_LAUGH_SHORT --&amp;gt;&lt;br /&gt;
|laugh_short&lt;br /&gt;
|ca5b3f14-3194-7a2b-c894-aa699b718d1f&lt;br /&gt;
|avatar_laugh_short.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_laugh_emote&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_MEDIUM_LAND --&amp;gt;&lt;br /&gt;
|soft_land&lt;br /&gt;
|f4f00d6e-b9fe-9292-f4cb-0ae06ea58d57&lt;br /&gt;
|avatar_soft_land.bvh&lt;br /&gt;
|2&lt;br /&gt;
|Yes&lt;br /&gt;
|Stopped automatically by viewer&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_MOTORCYCLE_SIT --&amp;gt;&lt;br /&gt;
|motorcycle_sit&lt;br /&gt;
|08464f78-3a8e-2944-cba5-0c94aff3af29&lt;br /&gt;
|avatar_motorcycle_sit.bvh&lt;br /&gt;
|4&lt;br /&gt;
|Yes&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_MUSCLE_BEACH --&amp;gt;&lt;br /&gt;
|musclebeach&lt;br /&gt;
|315c3a41-a5f3-0ba4-27da-f893f769e69b&lt;br /&gt;
|avatar_musclebeach.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_anger_emote&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_NO --&amp;gt;&lt;br /&gt;
|no_head&lt;br /&gt;
|5a977ed9-7f72-44e9-4c4c-6e913df8ae74&lt;br /&gt;
|avatar_no_head.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_NO_UNHAPPY --&amp;gt;&lt;br /&gt;
|no_unhappy&lt;br /&gt;
|d83fa0e5-97ed-7eb2-e798-7bd006215cb4&lt;br /&gt;
|avatar_no_unhappy.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_frown&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_NYAH_NYAH --&amp;gt;&lt;br /&gt;
|nyanya&lt;br /&gt;
|f061723d-0a18-754f-66ee-29a44795a32f&lt;br /&gt;
|avatar_nyanya.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_tongue_out&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_ONETWO_PUNCH --&amp;gt;&lt;br /&gt;
|punch_onetwo&lt;br /&gt;
|eefc79be-daae-a239-8c04-890f5d23654a&lt;br /&gt;
|avatar_punch_onetwo.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_frown&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_PEACE --&amp;gt;&lt;br /&gt;
|peace&lt;br /&gt;
|b312b10e-65ab-a0a4-8b3c-1326ea8e3ed9&lt;br /&gt;
|avatar_peace.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_smile&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_POINT_ME --&amp;gt;&lt;br /&gt;
|point_me&lt;br /&gt;
|17c024cc-eef2-f6a0-3527-9869876d7752&lt;br /&gt;
|avatar_point_me.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_POINT_YOU --&amp;gt;&lt;br /&gt;
|point_you&lt;br /&gt;
|ec952cca-61ef-aa3b-2789-4d1344f016de&lt;br /&gt;
|avatar_point_you.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_PRE_JUMP --&amp;gt;&lt;br /&gt;
|prejump&lt;br /&gt;
|7a4e87fe-de39-6fcb-6223-024b00893244&lt;br /&gt;
|avatar_prejump.bvh&lt;br /&gt;
|0&lt;br /&gt;
|Yes&lt;br /&gt;
|Stopped automatically by viewer {{JIRA|SVC-3860}}&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_PUNCH_LEFT --&amp;gt;&lt;br /&gt;
|punch_l&lt;br /&gt;
|f3300ad9-3462-1d07-2044-0fef80062da0&lt;br /&gt;
|avatar_punch_l.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_frown&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_PUNCH_RIGHT --&amp;gt;&lt;br /&gt;
|punch_r&lt;br /&gt;
|c8e42d32-7310-6906-c903-cab5d4a34656&lt;br /&gt;
|avatar_punch_r.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_frown&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_REPULSED --&amp;gt;&lt;br /&gt;
|express_repulsed&lt;br /&gt;
|36f81a92-f076-5893-dc4b-7c3795e487cf&lt;br /&gt;
|avatar_express_repulsed.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_repulsed_emote&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_ROUNDHOUSE_KICK --&amp;gt;&lt;br /&gt;
|kick_roundhouse_r&lt;br /&gt;
|49aea43b-5ac3-8a44-b595-96100af0beda&lt;br /&gt;
|avatar_kick_roundhouse_r.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|also triggers express_anger_emote&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_RPS_COUNTDOWN --&amp;gt;&lt;br /&gt;
|rps_countdown&lt;br /&gt;
|35db4f7e-28c2-6679-cea9-3ee108f7fc7f&lt;br /&gt;
|avatar_rps_countdown.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_toothsmile&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_RPS_PAPER --&amp;gt;&lt;br /&gt;
|rps_paper&lt;br /&gt;
|0836b67f-7f7b-f37b-c00a-460dc1521f5a&lt;br /&gt;
|avatar_rps_paper.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_surprise_emote&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_RPS_ROCK --&amp;gt;&lt;br /&gt;
|rps_rock&lt;br /&gt;
|42dd95d5-0bc6-6392-f650-777304946c0f&lt;br /&gt;
|avatar_rps_rock.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_surprise_emote&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_RPS_SCISSORS --&amp;gt;&lt;br /&gt;
|rps_scissors&lt;br /&gt;
|16803a9f-5140-e042-4d7b-d28ba247c325&lt;br /&gt;
|avatar_rps_scissors.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_surprise_emote&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_RUN --&amp;gt;&lt;br /&gt;
|run&lt;br /&gt;
|05ddbff8-aaa9-92a1-2b74-8fe77a29b445&lt;br /&gt;
|avatar_run.bvh&lt;br /&gt;
|0&lt;br /&gt;
|Yes&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_SAD --&amp;gt;&lt;br /&gt;
|express_sad&lt;br /&gt;
|0eb702e2-cc5a-9a88-56a5-661a55c0676a&lt;br /&gt;
|avatar_express_sad.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_sad_emote&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_SALUTE --&amp;gt;&lt;br /&gt;
|salute&lt;br /&gt;
|cd7668a6-7011-d7e2-ead8-fc69eff1a104&lt;br /&gt;
|avatar_salute.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_frown&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_SHOOT_BOW_L --&amp;gt;&lt;br /&gt;
|shoot_l_bow&lt;br /&gt;
|e04d450d-fdb5-0432-fd68-818aaf5935f8&lt;br /&gt;
|avatar_shoot_l_bow.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_SHOUT --&amp;gt;&lt;br /&gt;
|shout&lt;br /&gt;
|6bd01860-4ebd-127a-bb3d-d1427e8e0c42&lt;br /&gt;
|avatar_shout.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_laugh_emote. Sent with &amp;quot;shout&amp;quot; volume chat from viewer&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_SHRUG --&amp;gt;&lt;br /&gt;
|express_shrug&lt;br /&gt;
|70ea714f-3a97-d742-1b01-590a8fcd1db5&lt;br /&gt;
|avatar_express_shrug.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_shrug_emote&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_SIT --&amp;gt;&lt;br /&gt;
|sit&lt;br /&gt;
|1a5fe8ac-a804-8a5d-7cbd-56bd83184568&lt;br /&gt;
|avatar_sit.bvh&lt;br /&gt;
|4&lt;br /&gt;
|Yes&lt;br /&gt;
|Automatically replaced by sit_female if female shape is worn&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_SIT_FEMALE --&amp;gt;&lt;br /&gt;
|sit_female&lt;br /&gt;
|b1709c8d-ecd3-54a1-4f28-d55ac0840782&lt;br /&gt;
|avatar_sit_female.bvh&lt;br /&gt;
|4&lt;br /&gt;
|Yes&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_SIT_GROUND --&amp;gt;&lt;br /&gt;
|sit_ground&lt;br /&gt;
|1c7600d6-661f-b87b-efe2-d7421eb93c86&lt;br /&gt;
|avatar_sit_ground.bvh&lt;br /&gt;
|3&lt;br /&gt;
|Yes&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_SIT_GROUND_CONSTRAINED --&amp;gt;&lt;br /&gt;
|sit_ground_constrained&lt;br /&gt;
|1a2bd58e-87ff-0df8-0b4c-53e047b0bb6e&lt;br /&gt;
|avatar_sit_ground_constrained.bvh&lt;br /&gt;
|3&lt;br /&gt;
|Yes&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_SIT_GENERIC --&amp;gt;&lt;br /&gt;
|sit_generic&lt;br /&gt;
|245f3c54-f1c0-bf2e-811f-46d8eeb386e7&lt;br /&gt;
|avatar_sit_generic.bvh&lt;br /&gt;
|4&lt;br /&gt;
|Yes&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_SIT_TO_STAND --&amp;gt;&lt;br /&gt;
|sit_to_stand&lt;br /&gt;
|a8dee56f-2eae-9e7a-05a2-6fb92b97e21e&lt;br /&gt;
|avatar_sit_to_stand.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_SLEEP --&amp;gt;&lt;br /&gt;
|sleep&lt;br /&gt;
|f2bed5f9-9d44-39af-b0cd-257b2a17fe40&lt;br /&gt;
|avatar_sleep.bvh&lt;br /&gt;
|4&lt;br /&gt;
|Yes&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_SMOKE_IDLE --&amp;gt;&lt;br /&gt;
|smoke_idle&lt;br /&gt;
|d2f2ee58-8ad1-06c9-d8d3-3827ba31567a&lt;br /&gt;
|avatar_smoke_idle.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_SMOKE_INHALE --&amp;gt;&lt;br /&gt;
|smoke_inhale&lt;br /&gt;
|6802d553-49da-0778-9f85-1599a2266526&lt;br /&gt;
|avatar_smoke_inhale.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_kiss&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_SMOKE_THROW_DOWN --&amp;gt;&lt;br /&gt;
|smoke_throw_down&lt;br /&gt;
|0a9fb970-8b44-9114-d3a9-bf69cfe804d6&lt;br /&gt;
|avatar_smoke_throw_down.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_SNAPSHOT --&amp;gt;&lt;br /&gt;
|snapshot&lt;br /&gt;
|eae8905b-271a-99e2-4c0e-31106afd100c&lt;br /&gt;
|avatar_snapshot.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_toothsmile&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_STAND --&amp;gt;&lt;br /&gt;
|stand&lt;br /&gt;
|2408fe9e-df1d-1d7d-f4ff-1384fa7b350f&lt;br /&gt;
|avatar_stand.bvh&lt;br /&gt;
|0&lt;br /&gt;
|Yes&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_STANDUP --&amp;gt;&lt;br /&gt;
|standup&lt;br /&gt;
|3da1d753-028a-5446-24f3-9c9b856d9422&lt;br /&gt;
|avatar_standup.bvh&lt;br /&gt;
|3&lt;br /&gt;
|Yes&lt;br /&gt;
|Stopped automatically by viewer. Viewer also randomly triggers brush on stop.&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_STAND_1 --&amp;gt;&lt;br /&gt;
|stand_1&lt;br /&gt;
|15468e00-3400-bb66-cecc-646d7c14458e&lt;br /&gt;
|avatar_stand_1.bvh&lt;br /&gt;
|0&lt;br /&gt;
|Yes&lt;br /&gt;
|Stopped automatically by viewer&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_STAND_2 --&amp;gt;&lt;br /&gt;
|stand_2&lt;br /&gt;
|370f3a20-6ca6-9971-848c-9a01bc42ae3c&lt;br /&gt;
|avatar_stand_2.bvh&lt;br /&gt;
|0&lt;br /&gt;
|Yes&lt;br /&gt;
|Stopped automatically by viewer&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_STAND_3 --&amp;gt;&lt;br /&gt;
|stand_3&lt;br /&gt;
|42b46214-4b44-79ae-deb8-0df61424ff4b&lt;br /&gt;
|avatar_stand_3.bvh&lt;br /&gt;
|0&lt;br /&gt;
|Yes&lt;br /&gt;
|Stopped automatically by viewer&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_STAND_4 --&amp;gt;&lt;br /&gt;
|stand_4&lt;br /&gt;
|f22fed8b-a5ed-2c93-64d5-bdd8b93c889f&lt;br /&gt;
|avatar_stand_4.bvh&lt;br /&gt;
|0&lt;br /&gt;
|Yes&lt;br /&gt;
|Stopped automatically by viewer&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_STRETCH --&amp;gt;&lt;br /&gt;
|stretch&lt;br /&gt;
|80700431-74ec-a008-14f8-77575e73693f&lt;br /&gt;
|avatar_stretch.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_STRIDE --&amp;gt;&lt;br /&gt;
|stride&lt;br /&gt;
|1cb562b0-ba21-2202-efb3-30f82cdf9595&lt;br /&gt;
|avatar_stride.bvh&lt;br /&gt;
|1&lt;br /&gt;
|Yes&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_SURF --&amp;gt;&lt;br /&gt;
|surf&lt;br /&gt;
|41426836-7437-7e89-025d-0aa4d10f1d69&lt;br /&gt;
|avatar_surf.bvh&lt;br /&gt;
|4&lt;br /&gt;
|Yes&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_SURPRISE --&amp;gt;&lt;br /&gt;
|express_surprise&lt;br /&gt;
|313b9881-4302-73c0-c7d0-0e7a36b6c224&lt;br /&gt;
|avatar_express_surprise.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_surprise_emote&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_SWORD_STRIKE --&amp;gt;&lt;br /&gt;
|sword_strike_r&lt;br /&gt;
|85428680-6bf9-3e64-b489-6f81087c24bd&lt;br /&gt;
|avatar_sword_strike_r.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_frown&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_TALK --&amp;gt;&lt;br /&gt;
|talk&lt;br /&gt;
|5c682a95-6da4-a463-0bf6-0f5b7be129d1&lt;br /&gt;
|avatar_talk.bvh&lt;br /&gt;
|1&lt;br /&gt;
|No&lt;br /&gt;
|Nod sent with &amp;quot;say&amp;quot; volume chat from viewer&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_TANTRUM --&amp;gt;&lt;br /&gt;
|angry_tantrum&lt;br /&gt;
|11000694-3f41-adc2-606b-eee1d66f3724&lt;br /&gt;
|avatar_angry_tantrum.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_anger_remote&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_THROW_R --&amp;gt;&lt;br /&gt;
|throw_r&lt;br /&gt;
|aa134404-7dac-7aca-2cba-435f9db875ca&lt;br /&gt;
|avatar_throw_r.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_TRYON_SHIRT --&amp;gt;&lt;br /&gt;
|tryon_shirt&lt;br /&gt;
|83ff59fe-2346-f236-9009-4e3608af64c1&lt;br /&gt;
|avatar_tryon_shirt.bvh&lt;br /&gt;
|1&lt;br /&gt;
|No&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_TURNLEFT --&amp;gt;&lt;br /&gt;
|turnleft&lt;br /&gt;
|56e0ba0d-4a9f-7f27-6117-32f2ebbf6135&lt;br /&gt;
|avatar_turnleft.bvh&lt;br /&gt;
|1&lt;br /&gt;
|Yes&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_TURNRIGHT --&amp;gt;&lt;br /&gt;
|turnright&lt;br /&gt;
|2d6daa51-3192-6794-8e2e-a15f8338ec30&lt;br /&gt;
|avatar_turnright.bvh&lt;br /&gt;
|1&lt;br /&gt;
|Yes&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_TYPE --&amp;gt;&lt;br /&gt;
|type&lt;br /&gt;
|c541c47f-e0c0-058b-ad1a-d6ae3a4584d9&lt;br /&gt;
|avatar_type.bvh&lt;br /&gt;
|2&lt;br /&gt;
|Yes&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_WALK --&amp;gt;&lt;br /&gt;
|walk&lt;br /&gt;
|6ed24bd8-91aa-4b12-ccc7-c97c857ab4e0&lt;br /&gt;
|avatar_walk.bvh&lt;br /&gt;
|3 &amp;amp; 0&lt;br /&gt;
|Yes{{Footnote|&amp;quot;walk&amp;quot; is treated specially in the viewer. The animation played standalone is not looped, the viewer does the looping so it can adjust for walking speed. Since viewer 2.1, the walk loop rate is fixed so it behaves like a normal looped animation. If you want to use the default walk in a scripted device with a sitting avatar, female_walk will give better results.}}&lt;br /&gt;
|Automatically replaced by female_walk if female shape is worn (priority 3 for pelvis and legs, 0 for everything else)&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_WHISPER --&amp;gt;&lt;br /&gt;
|whisper&lt;br /&gt;
|7693f268-06c7-ea71-fa21-2b30d6533f8f&lt;br /&gt;
|avatar_whisper.bvh&lt;br /&gt;
|0&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_wink_emote. Sent with &amp;quot;whisper&amp;quot; volume chat from viewer&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_WHISTLE --&amp;gt;&lt;br /&gt;
|whistle&lt;br /&gt;
|b1ed7982-c68e-a982-7561-52a88a5298c0&lt;br /&gt;
|avatar_whistle.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_kiss&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_WINK --&amp;gt;&lt;br /&gt;
|express_wink&lt;br /&gt;
|869ecdad-a44b-671e-3266-56aef2e3ac2e&lt;br /&gt;
|avatar_express_wink.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_wink_emote&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_WINK_HOLLYWOOD --&amp;gt;&lt;br /&gt;
|wink_hollywood&lt;br /&gt;
|c0c4030f-c02b-49de-24ba-2331f43fe41c&lt;br /&gt;
|avatar_wink_hollywood.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_wink_emote&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_WORRY --&amp;gt;&lt;br /&gt;
|express_worry&lt;br /&gt;
|9f496bd2-589a-709f-16cc-69bf7df1d36c&lt;br /&gt;
|avatar_express_worry.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_worry_emote&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_YES --&amp;gt;&lt;br /&gt;
|yes_head&lt;br /&gt;
|15dd911d-be82-2856-26db-27659b142875&lt;br /&gt;
|avatar_yes_head.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_YES_HAPPY --&amp;gt;&lt;br /&gt;
|yes_happy&lt;br /&gt;
|b8c8b2a3-9008-1771-3bfc-90924955ab2d&lt;br /&gt;
|avatar_yes_happy.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_toothsmile&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_YOGA_FLOAT --&amp;gt;&lt;br /&gt;
|yoga_float&lt;br /&gt;
|42ecd00b-9947-a97c-400a-bbc9174c7aeb&lt;br /&gt;
|avatar_yoga_float.bvh&lt;br /&gt;
|2&lt;br /&gt;
|No&lt;br /&gt;
|Also triggers express_bored_remote&lt;br /&gt;
|}&lt;br /&gt;
===Facial expressions===&lt;br /&gt;
[[Image:SL face expressions.jpg|200px|thumb|left|Samples of the facial expressions from the table above, click to enlarge.]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear:both;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Viewer-generated motions==&lt;br /&gt;
Some types of movement are generated at run time by the viewer, in response to the environment.  Like regular animations most have names and UUIDs, but they are not available to be stopped, started or even seen by scripts. These motions do have priorities and can be overridden. Names and UUIDs are defined in newview/llvoavatar.h.&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; {{prettytable}}&lt;br /&gt;
|-{{Hl2}}&lt;br /&gt;
!Animation Name&lt;br /&gt;
![[UUID]]&lt;br /&gt;
!Source&lt;br /&gt;
!Priority&lt;br /&gt;
!class=&amp;quot;unsortable&amp;quot;|Description&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_BODY_NOISE --&amp;gt;&lt;br /&gt;
|body_noise&lt;br /&gt;
|9aa8b0a6-0c6f-9518-c7c3-4f41f2c001ad&lt;br /&gt;
|LLBodyNoiseMotion in newview/llvoavatar.cpp&lt;br /&gt;
|2&lt;br /&gt;
|Minor body turns. Joints moved: torso.&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_BREATHE_ROT --&amp;gt;&lt;br /&gt;
|breathe_rot&lt;br /&gt;
|4c5a103e-b830-2f1c-16bc-224aa0ad5bc8&lt;br /&gt;
|LLBreatheMotionRot in newview/llvoavatar.cpp&lt;br /&gt;
|1&lt;br /&gt;
|Breathing simulation. Joints moved: chest&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_EDITING --&amp;gt;&lt;br /&gt;
|editing&lt;br /&gt;
|2a8eba1d-a7f8-5596-d44a-b4977bf8c8bb&lt;br /&gt;
|LLEditingMotion in llcharacter/lleditingmotion.cpp&lt;br /&gt;
|2&lt;br /&gt;
|Left arm follows selected and edited objects. Joints moved: left shoulder, left elbow, left wrist, torso.&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_EYE --&amp;gt;&lt;br /&gt;
|eye&lt;br /&gt;
|5c780ea8-1cd1-c463-a128-48c023f6fbea&lt;br /&gt;
|LLEyeMotion in llcharacter/llheadrotmotion.cpp&lt;br /&gt;
|1&lt;br /&gt;
|Eye rotation and blinking.  Joints moved: head, left eye, right eye&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_FLY_ADJUST --&amp;gt;&lt;br /&gt;
|fly_adjust&lt;br /&gt;
|db95561f-f1b0-9f9a-7224-b12f71af126e&lt;br /&gt;
|LLFlyAdjustMotion in llcharacter/llkeyframewalkmotion.cpp&lt;br /&gt;
|3&lt;br /&gt;
|Add body roll during flight. Joints moved: pelvis&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_HAND_MOTION --&amp;gt;&lt;br /&gt;
|hand_motion&lt;br /&gt;
|ce986325-0ba7-6e6e-cc24-b17c4b795578&lt;br /&gt;
|LLHandMotion in llcharacter/llhandmotion.cpp&lt;br /&gt;
|1&lt;br /&gt;
|Sets standard hand poses defined in other animations&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_HEAD_ROT --&amp;gt;&lt;br /&gt;
|head_rot&lt;br /&gt;
|e6e8d1dd-e643-fff7-b238-c6b4b056a68d&lt;br /&gt;
|LLHeadRotMotion in llcharacter/llheadrotmotion.cpp&lt;br /&gt;
|1&lt;br /&gt;
|Moves head and torso to follow the avatar&#039;s look at position (cursor, camera).  Joints moved: torso, neck, head&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_PELVIS_FIX --&amp;gt;&lt;br /&gt;
|pelvis_fix&lt;br /&gt;
|0c5dd2a2-514d-8893-d44d-05beffad208b&lt;br /&gt;
|LLPelvisFixMotion in newview/llvoavatar.cpp&lt;br /&gt;
|0&lt;br /&gt;
|Makes corrections to keep avatar standing upright. Joints moved: pelvis&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_TARGET --&amp;gt;&lt;br /&gt;
|target&lt;br /&gt;
|0e4896cb-fba4-926c-f355-8720189d5b55&lt;br /&gt;
|LLTargetingMotion in llcharacter/lltargetingmotion.cpp&lt;br /&gt;
|2&lt;br /&gt;
|Move body with look at position, used during aim_* animations above. Joints moved: pelvis, torso, right wrist&lt;br /&gt;
|- &amp;lt;!-- ANIM_AGENT_WALK_ADJUST --&amp;gt;&lt;br /&gt;
|walk_adjust&lt;br /&gt;
|829bc85b-02fc-ec41-be2e-74cc6dd7215d&lt;br /&gt;
|LLWalkAdjustMotion in llcharacter/llkeyframewalkmotion.cpp&lt;br /&gt;
|2&lt;br /&gt;
|Makes walking corrections for terrain, turns. Joints moved: pelvis, left ankle, right ankle&lt;br /&gt;
|- &amp;lt;!-- Oo --&amp;gt;&lt;br /&gt;
| Lipsync_Ooh Lipsync_Aah&lt;br /&gt;
|(none assigned)&lt;br /&gt;
|character/avatar_lad.xml&lt;br /&gt;
|&lt;br /&gt;
|Mouth movement for voice [[LipSync|lip sync]] feature&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Footnotes==&lt;br /&gt;
{{Footnotes}}&lt;br /&gt;
[[Category:LSL_Animation]]&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=GIMP_Layers_to_SL_Animated_Texture&amp;diff=1194731</id>
		<title>GIMP Layers to SL Animated Texture</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=GIMP_Layers_to_SL_Animated_Texture&amp;diff=1194731"/>
		<updated>2015-01-24T04:56:05Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: &amp;lt;scheme&amp;gt; to &amp;lt;source&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a GIMP script (written in Script-Fu, the Scheme-based scripting language that GIMP uses) that takes the layers of an image representing an animation, and converts them into a texture suitable for use with &#039;&#039;&#039;[[llSetTextureAnim]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Copy and paste the script below into a simple text editor of your choice (Notepad is probably the best choice for Windows systems). Save it into your scripts folder with the extension .scm - the suggested name is &amp;quot;layers-to-sl-animation.scm&amp;quot;. The scripts folder can be found by going to &#039;&#039;Preferences &amp;gt; Folders &amp;gt; Scripts&#039;&#039;. After it&#039;s in the &#039;&#039;Scripts&#039;&#039; folder, do a refresh by selecting &#039;&#039;Filters &amp;gt; Script-Fu &amp;gt; Refresh Scripts&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
First, create or load an animation with one layer per frame (the first frame is the bottom layer). An existing GIF animation will work for this purpose, or you can create your own, or import one if you have enough memory. Version 1.0 of this script required to use the Unoptimize filter first in some cases; as of version 2.0, that functionality is already built in.&lt;br /&gt;
&lt;br /&gt;
Next, ensure that it has the correct size and number of frames desired. It&#039;s preferable to have a plan at this point of what the final resolution will be, and how many horizontal and vertical frames the final image will have. If you are not going to use all the frames in your final image (for example, you have 5 frames and decide to do a 3x2 image), you still need to fill the holes. Create empty layers or duplicate existing ones until completing the final frame count. If you need to rescale the image at this point and the image is indexed, it&#039;s better if you convert it to RGB mode first.&lt;br /&gt;
&lt;br /&gt;
Now invoke the script. It is invoked using &#039;&#039;Script-fu &amp;gt; SecondLife &amp;gt; Frames to texture...&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A window will appear, asking the number of horizontal and vertical frames of the final image. As noted above, that number must match the number of frames in your layers, or the script will show an error instead. It also asks whether you want to generate an animation script in a message window, and the frame rate to use for that script. Click OK and you will get a new image window consisting of the original frames arranged according to the specified values, suitable for use in SL. Now you can save the file and upload it to SL. If you had the script generation option checked, you can select the code from the window that appears, copy it, and paste it as a LSL script replacing the contents.&lt;br /&gt;
&lt;br /&gt;
== The script ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;scheme&amp;quot;&amp;gt;&lt;br /&gt;
; Layers to SL Texture Animation, version 2.0.1&lt;br /&gt;
;&lt;br /&gt;
; Written by Pedro Oval, 2010-12-04.&lt;br /&gt;
; Donated to the public domain.&lt;br /&gt;
; Thanks to Digital Dharma for the suggestions.&lt;br /&gt;
&lt;br /&gt;
(define (script-fu-layers-to-sl-anim curimg curdrawable xframes yframes showscript fps)&lt;br /&gt;
&lt;br /&gt;
  ; Local function: check if a string contains a substring&lt;br /&gt;
  (define (contains-ci str substr)&lt;br /&gt;
    (define i 0)&lt;br /&gt;
    (define lensub (string-length substr))&lt;br /&gt;
    (define imax (- (string-length str) lensub))&lt;br /&gt;
    (if (negative? imax)&lt;br /&gt;
      #f&lt;br /&gt;
      (begin&lt;br /&gt;
        (define found #f)&lt;br /&gt;
        (while (and (not found) (&amp;lt;= i imax))&lt;br /&gt;
          ; We make a case-insensitive comparison.&lt;br /&gt;
          (if (string-ci=? (substring str i (+ i lensub)) substr)&lt;br /&gt;
            (set! found #t)&lt;br /&gt;
            (set! i (+ i 1))))&lt;br /&gt;
        found)))&lt;br /&gt;
&lt;br /&gt;
  ; Read the layer IDs and the total number of layers from the original image.&lt;br /&gt;
  (define layerset (gimp-image-get-layers curimg))&lt;br /&gt;
  (define numframes (car layerset))&lt;br /&gt;
  (set! layerset (cadr layerset))&lt;br /&gt;
&lt;br /&gt;
  ; The frame size X and Y is the size of the original image.&lt;br /&gt;
  (define framesizex (car (gimp-image-width curimg)))&lt;br /&gt;
  (define framesizey (car (gimp-image-height curimg)))&lt;br /&gt;
&lt;br /&gt;
  ; Get the image type; indexed images need special treatment.&lt;br /&gt;
  (define imgtype (car (gimp-image-base-type curimg)))&lt;br /&gt;
&lt;br /&gt;
  ; Check if the given number of horizontal x vertical frames matches&lt;br /&gt;
  ; the number of layers in the original image. If yes, proceed; if not,&lt;br /&gt;
  ; show an error message.&lt;br /&gt;
  (if (= numframes (* xframes yframes))&lt;br /&gt;
    (begin&lt;br /&gt;
      ; New image&lt;br /&gt;
      (define img (car (gimp-image-new (* framesizex xframes) (* framesizey yframes) imgtype)))&lt;br /&gt;
      ; We create a new image, so we disable undo for it; to &amp;quot;undo&amp;quot;&lt;br /&gt;
      ; the script, just close the new image.&lt;br /&gt;
      (gimp-image-undo-disable img)&lt;br /&gt;
&lt;br /&gt;
      (if (= imgtype INDEXED)&lt;br /&gt;
        (begin&lt;br /&gt;
          ; Indexed images need the palette to be copied to the new image.&lt;br /&gt;
          (define palette (gimp-image-get-colormap curimg))&lt;br /&gt;
          (gimp-image-set-colormap img (car palette) (cadr palette))))&lt;br /&gt;
&lt;br /&gt;
      ; Initialize previous layer info to 0, as there&#039;s no previous layer yet.&lt;br /&gt;
      ; On the next iteration it will hold a list with:&lt;br /&gt;
      ;  layer ID, offset X, offset Y.&lt;br /&gt;
      (define prevlayerinfo 0)&lt;br /&gt;
&lt;br /&gt;
      ; Loop betwen 0 and numframes - 1.&lt;br /&gt;
      (define frame 0)&lt;br /&gt;
      (while (&amp;lt; frame numframes)&lt;br /&gt;
        ; For each layer/frame:&lt;br /&gt;
        (begin&lt;br /&gt;
&lt;br /&gt;
          ; Show progress as the current frame relative to the number of frames.&lt;br /&gt;
          (gimp-progress-update (/ frame numframes))&lt;br /&gt;
&lt;br /&gt;
          ; Read the individual layer ID, starting from the bottom.&lt;br /&gt;
          (define oldlayer (vector-ref layerset (- numframes frame 1)))&lt;br /&gt;
&lt;br /&gt;
          ; Create new layer as a copy of this one and add it to the image.&lt;br /&gt;
          (define newlayer (car (gimp-layer-new-from-drawable oldlayer img)))&lt;br /&gt;
          (gimp-image-add-layer img newlayer -1)&lt;br /&gt;
&lt;br /&gt;
          ; Add alpha if the layer doesn&#039;t have it.&lt;br /&gt;
          (if (= (car (gimp-drawable-has-alpha newlayer)) FALSE)&lt;br /&gt;
            (gimp-layer-add-alpha newlayer))&lt;br /&gt;
&lt;br /&gt;
          ; Calculate the offsets relative to the destination rectangle,&lt;br /&gt;
          ; and the crop size.&lt;br /&gt;
          (define offsets (gimp-drawable-offsets oldlayer))&lt;br /&gt;
          (define newsizex (car (gimp-drawable-width oldlayer)))&lt;br /&gt;
          (define newsizey (car (gimp-drawable-height oldlayer)))&lt;br /&gt;
          (define offsetx (car offsets))&lt;br /&gt;
          (define offsety (cadr offsets))&lt;br /&gt;
          (if (&amp;lt; offsetx 0)&lt;br /&gt;
            (begin&lt;br /&gt;
              (set! newsizex (+ newsizex offsetx))&lt;br /&gt;
              (set! offsetx 0)))&lt;br /&gt;
          (if (&amp;lt; offsety 0)&lt;br /&gt;
            (begin&lt;br /&gt;
              (set! newsizey (+ newsizey offsety))&lt;br /&gt;
              (set! offsety 0)))&lt;br /&gt;
          (if (&amp;gt; (+ offsetx newsizex) framesizex)&lt;br /&gt;
            (set! newsizex (- framesizex offsetx)))&lt;br /&gt;
          (if (&amp;gt; (+ offsety newsizey) framesizey)&lt;br /&gt;
            (set! newsizey (- framesizey offsety)))&lt;br /&gt;
&lt;br /&gt;
          ; Calculate frame rectangle&#039;s top left position.&lt;br /&gt;
          (define framey (truncate (/ frame xframes)))&lt;br /&gt;
          (define framex (- frame (* framey xframes)))&lt;br /&gt;
          (set! framex (* framex framesizex))&lt;br /&gt;
          (set! framey (* framey framesizey))&lt;br /&gt;
&lt;br /&gt;
          ; Crop the layer if necessary so that it fits its&lt;br /&gt;
          ; rectangle, and move it to its final position.&lt;br /&gt;
          (gimp-layer-resize newlayer&lt;br /&gt;
                             newsizex&lt;br /&gt;
                             newsizey&lt;br /&gt;
                             (- (car offsets) offsetx)&lt;br /&gt;
                             (- (cadr offsets) offsety))&lt;br /&gt;
          (gimp-layer-set-offsets newlayer (+ framex offsetx) (+ framey offsety))&lt;br /&gt;
&lt;br /&gt;
          ; Force it visible.&lt;br /&gt;
          (gimp-drawable-set-visible newlayer TRUE)&lt;br /&gt;
&lt;br /&gt;
          ; Check for (combine) mode. Note: It just works&lt;br /&gt;
          ; in layers other than 0. Otherwise no action is&lt;br /&gt;
          ; done. It makes no sense for the bottom layer to&lt;br /&gt;
          ; use combine mode anyway.&lt;br /&gt;
          (if (and (&amp;gt; frame 0) (contains-ci (car (gimp-drawable-get-name oldlayer)) &amp;quot;(combine)&amp;quot;))&lt;br /&gt;
            (begin&lt;br /&gt;
              ; Duplicate the previous layer to serve as a base&lt;br /&gt;
              ; for the differencing frame being added.&lt;br /&gt;
              (define layercopy (car (gimp-layer-new-from-drawable (car prevlayerinfo) img)))&lt;br /&gt;
&lt;br /&gt;
              ; Add the new layer below the last layer.&lt;br /&gt;
              (gimp-image-add-layer img layercopy 1)&lt;br /&gt;
&lt;br /&gt;
              ; Set the layer position to match that of the new layer.&lt;br /&gt;
              (gimp-layer-set-offsets layercopy (+ framex (cadr prevlayerinfo))&lt;br /&gt;
                                                (+ framey (caddr prevlayerinfo)))&lt;br /&gt;
&lt;br /&gt;
              ; Ensure the previous layer&#039;s copy is visible.&lt;br /&gt;
              (gimp-drawable-set-visible layercopy TRUE)&lt;br /&gt;
&lt;br /&gt;
              ; Merge the differencing frame into the previous layer&#039;s copy.&lt;br /&gt;
              (set! newlayer (car (gimp-image-merge-down img newlayer EXPAND-AS-NECESSARY)))&lt;br /&gt;
&lt;br /&gt;
              ; Correct the offsets. We use &#039;min&#039; to match what&lt;br /&gt;
              ; EXPAND-AS-NECESSARY has supposedly done. Ideally&lt;br /&gt;
              ; we should read the new offsets and subtract&lt;br /&gt;
              ; framex/framey from them, but this is faster and simpler,&lt;br /&gt;
              (set! offsetx (min offsetx (cadr prevlayerinfo)))&lt;br /&gt;
              (set! offsety (min offsety (caddr prevlayerinfo)))))&lt;br /&gt;
&lt;br /&gt;
          ; Previous layer = this.&lt;br /&gt;
          (set! prevlayerinfo (list newlayer offsetx offsety))&lt;br /&gt;
&lt;br /&gt;
          ; All done. Next loop iteration.&lt;br /&gt;
          (set! frame (+ frame 1))))&lt;br /&gt;
&lt;br /&gt;
      ; Progress 100%&lt;br /&gt;
      (gimp-progress-update 1.0)&lt;br /&gt;
&lt;br /&gt;
      ; Merge visible layers (all are visible now).&lt;br /&gt;
      (define mergedlayer (car (gimp-image-merge-visible-layers img CLIP-TO-IMAGE)))&lt;br /&gt;
&lt;br /&gt;
      ; Make the new layer the size of the image.&lt;br /&gt;
      (gimp-layer-resize-to-image-size mergedlayer)&lt;br /&gt;
&lt;br /&gt;
      ; Convert the image to RGB if it is not already.&lt;br /&gt;
      (if (not (= imgtype RGB))&lt;br /&gt;
        (gimp-image-convert-rgb img))&lt;br /&gt;
&lt;br /&gt;
      ; Detect alpha by converting it to a selection.&lt;br /&gt;
      (gimp-selection-layer-alpha mergedlayer)&lt;br /&gt;
&lt;br /&gt;
      ; If there is no useful alpha, the selection should cover the whole image.&lt;br /&gt;
      ; Invert it, and if it becomes empty, then it means that alpha was not&lt;br /&gt;
      ; in use: the whole image was covered with 100% opacity.&lt;br /&gt;
      (gimp-selection-invert img)&lt;br /&gt;
      (define hasalpha (car (gimp-selection-bounds img)))&lt;br /&gt;
      (gimp-selection-none img)&lt;br /&gt;
&lt;br /&gt;
      ; If it didn&#039;t have any alpha, remove the alpha mask from the layer.&lt;br /&gt;
      (if (= hasalpha FALSE)&lt;br /&gt;
        (gimp-layer-flatten mergedlayer))&lt;br /&gt;
&lt;br /&gt;
      ; All done - enable undo again and add a display window for the new image.&lt;br /&gt;
      (gimp-image-undo-enable img)&lt;br /&gt;
      (gimp-display-new img)&lt;br /&gt;
&lt;br /&gt;
      ; Prepare a version of fps ending in .0 if it doesn&#039;t.&lt;br /&gt;
      (define fpsstr (number-&amp;gt;string fps))&lt;br /&gt;
      (if (not (contains-ci fpsstr &amp;quot;.&amp;quot;))&lt;br /&gt;
        (set! fpsstr (string-append fpsstr &amp;quot;.0&amp;quot;)))&lt;br /&gt;
&lt;br /&gt;
      ; Show the script if requested&lt;br /&gt;
      (if (= showscript TRUE)&lt;br /&gt;
        (gimp-message (string-append &amp;quot;// Copy-paste the following fragment as a script:\n\n&amp;quot;&lt;br /&gt;
                                     &amp;quot;default\n{\n    state_entry()\n    {\n&amp;quot;&lt;br /&gt;
                                     &amp;quot;        llSetTextureAnim(ANIM_ON | LOOP, &amp;quot;&lt;br /&gt;
                                     (number-&amp;gt;string xframes)&lt;br /&gt;
                                     &amp;quot;, &amp;quot;&lt;br /&gt;
                                     (number-&amp;gt;string yframes)&lt;br /&gt;
                                     &amp;quot;, 0.0, &amp;quot;&lt;br /&gt;
                                     (number-&amp;gt;string (* xframes yframes))&lt;br /&gt;
                                     &amp;quot;.0, &amp;quot;&lt;br /&gt;
                                     fpsstr &amp;quot;);\n    }\n}\n&amp;quot;))))&lt;br /&gt;
&lt;br /&gt;
    ; If the frame counts didn&#039;t match...&lt;br /&gt;
    (gimp-message &amp;quot;Error: Number of layers doesn&#039;t match horizontal x vertical frames&amp;quot;)))&lt;br /&gt;
&lt;br /&gt;
; Register the function.&lt;br /&gt;
(script-fu-register &amp;quot;script-fu-layers-to-sl-anim&amp;quot;&lt;br /&gt;
                    _&amp;quot;&amp;lt;Image&amp;gt;/Script-Fu/SecondLife/Frames to texture...&amp;quot;&lt;br /&gt;
                    _&amp;quot;Convert a set of layers (frames) to a texture suitable for llSetTextureAnim.&amp;quot;&lt;br /&gt;
                    &amp;quot;Pedro Oval&amp;quot;&lt;br /&gt;
                    _&amp;quot;Public Domain&amp;quot;&lt;br /&gt;
                    &amp;quot;2010-12-04&amp;quot;&lt;br /&gt;
                    &amp;quot;RGB*, GRAY*, INDEXED*&amp;quot;&lt;br /&gt;
                    SF-IMAGE        &amp;quot;Image&amp;quot;        0&lt;br /&gt;
                    SF-DRAWABLE     &amp;quot;Drawable&amp;quot;     0&lt;br /&gt;
                    SF-ADJUSTMENT   _&amp;quot;# of horizontal frames&amp;quot; &#039;(2 1 1024 1 10 0 1)&lt;br /&gt;
                    SF-ADJUSTMENT   _&amp;quot;# of vertical frames&amp;quot;   &#039;(2 1 1024 1 10 0 1)&lt;br /&gt;
                    SF-TOGGLE       _&amp;quot;Generate LSL script?&amp;quot;   TRUE&lt;br /&gt;
                    SF-VALUE        _&amp;quot;Frames per second (for script):&amp;quot; &amp;quot;10.0&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Change Log ==&lt;br /&gt;
&lt;br /&gt;
* Version 2.0.1 (2012-06-05):&lt;br /&gt;
** Disable undo instead of creating an undo group. Makes more sense to the user and saves memory.&lt;br /&gt;
* Version 2.0 (2010-12-22):&lt;br /&gt;
** Frames are no longer required to be the same size as the image.&lt;br /&gt;
** Recognize &amp;quot;combine&amp;quot; layers. Should work with all animated GIFs now.&lt;br /&gt;
** Option to generate the LSL script, active by default.&lt;br /&gt;
** Deal with alpha, so that it&#039;s removed if not needed and vice versa.&lt;br /&gt;
** Added progress indicator.&lt;br /&gt;
** Extensively commented.&lt;br /&gt;
* Version 1.0 (2010-12-04): First public release.&lt;br /&gt;
&lt;br /&gt;
See also [[User:Pedro Oval/GIMP Layers to SL Animated Texture]] for the (possibly unstable) current development version and future plans.&lt;br /&gt;
&lt;br /&gt;
== Credits/License ==&lt;br /&gt;
&lt;br /&gt;
Written by Pedro Oval. Donated to the public domain.&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Pedro_Oval/Table_of_implicit_type_conversions_for_list_extracting_functions&amp;diff=1194730</id>
		<title>User:Pedro Oval/Table of implicit type conversions for list extracting functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Pedro_Oval/Table_of_implicit_type_conversions_for_list_extracting_functions&amp;diff=1194730"/>
		<updated>2015-01-24T04:45:27Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: &amp;lt;lsl&amp;gt; to &amp;lt;source&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This table tells whether an implicit type cast is supported by &amp;lt;code&amp;gt;llList2*&amp;lt;/code&amp;gt; depending on the item type in the list. Last tested with this server version: Second Life Server 11.10.18.243270&lt;br /&gt;
&lt;br /&gt;
Updated 2011-10-30 with note on unsupported llList2Key conversions in LSO, which weren&#039;t tested before&lt;br /&gt;
&lt;br /&gt;
{| {{Prettytable}}&lt;br /&gt;
|- {{Hl2}}&lt;br /&gt;
!&amp;lt;br /&amp;gt;List item type:&amp;lt;br /&amp;gt;Function: !! string !! key !! integer !! float !! vector !! rotation&lt;br /&gt;
|- style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; {{Hl2}}|llList2String&lt;br /&gt;
| YES || YES || YES || YES || YES || YES&lt;br /&gt;
|- style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; {{Hl2}}|llList2Key&lt;br /&gt;
| YES || YES || no  || no  || no  || no&lt;br /&gt;
|- style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; {{Hl2}}|llList2Integer&lt;br /&gt;
| YES || no  || YES || YES || no  || no&lt;br /&gt;
|- style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; {{Hl2}}|llList2Float&lt;br /&gt;
| YES || no  || YES || YES || no  || no&lt;br /&gt;
|- style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; {{Hl2}}|llList2Vector&lt;br /&gt;
| no  || no  || no  || no  || YES || no&lt;br /&gt;
|- style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
!scope=&amp;quot;row&amp;quot; {{Hl2}}|llList2Rot&lt;br /&gt;
| no  || no  || no  || no  || no  || YES&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The non-supported conversions for &amp;lt;code&amp;gt;llList2Key&amp;lt;/code&amp;gt; return &amp;lt;code&amp;gt;(key)&amp;quot;&amp;quot;&amp;lt;/code&amp;gt; in Mono, and &amp;lt;code&amp;gt;(key)NULL_KEY&amp;lt;/code&amp;gt; in LSO.&lt;br /&gt;
&lt;br /&gt;
The non-supported conversions for &amp;lt;code&amp;gt;llList2Integer&amp;lt;/code&amp;gt; return &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The non-supported conversions for &amp;lt;code&amp;gt;llList2Float&amp;lt;/code&amp;gt; return &amp;lt;code&amp;gt;0.0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The non-supported conversions for &amp;lt;code&amp;gt;llList2Vector&amp;lt;/code&amp;gt; return &amp;lt;code&amp;gt;ZERO_VECTOR&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The non-supported conversions for &amp;lt;code&amp;gt;llList2Rot&amp;lt;/code&amp;gt; return &amp;lt;code&amp;gt;ZERO_ROTATION&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In short: &amp;lt;code&amp;gt;llList2String&amp;lt;/code&amp;gt; can be applied to all types. A string element can be extracted by all functions except &amp;lt;code&amp;gt;llList2Vector&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;llList2Rot&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;llList2Integer&amp;lt;/code&amp;gt; can extract a float, and &amp;lt;code&amp;gt;llList2Float&amp;lt;/code&amp;gt; can extract an integer. No other implicit conversions are supported.&lt;br /&gt;
&lt;br /&gt;
== Test code ==&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the program used to elaborate the above table:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
string CheckResults(integer ExpectedYes, integer ExpectedNo)&lt;br /&gt;
{&lt;br /&gt;
    if (ExpectedYes &amp;amp;&amp;amp; ExpectedNo)&lt;br /&gt;
    {&lt;br /&gt;
        // Inconsistent check - revise code&lt;br /&gt;
        return &amp;quot;*INCONSISTENT*&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (!ExpectedYes &amp;amp;&amp;amp; !ExpectedNo)&lt;br /&gt;
    {&lt;br /&gt;
        // Neither of the checks is met&lt;br /&gt;
        return &amp;quot;*UNEXPECTED*&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    if (ExpectedYes)&lt;br /&gt;
        return &amp;quot;  YES&amp;quot;;&lt;br /&gt;
    return &amp;quot;   no &amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string v2s(vector v)&lt;br /&gt;
{&lt;br /&gt;
    return &amp;quot;&amp;lt;&amp;quot;+(string)v.x+&amp;quot;, &amp;quot;+(string)v.y+&amp;quot;, &amp;quot;+(string)v.z+&amp;quot;&amp;gt;&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string r2s(rotation r)&lt;br /&gt;
{&lt;br /&gt;
    return &amp;quot;&amp;lt;&amp;quot;+(string)r.x+&amp;quot;, &amp;quot;+(string)r.y+&amp;quot;, &amp;quot;+(string)r.z+&amp;quot;, &amp;quot;+(string)r.s+&amp;quot;&amp;gt;&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        string line;&lt;br /&gt;
        string s;&lt;br /&gt;
        key k;&lt;br /&gt;
        integer i;&lt;br /&gt;
        float f;&lt;br /&gt;
        vector v;&lt;br /&gt;
        rotation r;&lt;br /&gt;
&lt;br /&gt;
        llOwnerSay(&amp;quot;--------------      s       k       i       f       v       r&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        line = &amp;quot;llList2String   &amp;quot;;&lt;br /&gt;
        s = &amp;quot;¡!¿?&amp;quot;;&lt;br /&gt;
        k = (key)&amp;quot;01234567-89ab-cdef-0123-456789abcdef&amp;quot;;&lt;br /&gt;
        i = -314159;&lt;br /&gt;
        f = -3.141592e33;&lt;br /&gt;
        v = &amp;lt;-1.22, 0.0, 9.9e9&amp;gt;;&lt;br /&gt;
        r = &amp;lt;0.33, 0.66, 0.33, 0.589&amp;gt;;&lt;br /&gt;
        line += CheckResults(llList2String([s], 0) == s, llList2String([s], 0) == &amp;quot;&amp;quot;);&lt;br /&gt;
        line += CheckResults(llList2String([k], 0) == (string)k, llList2String([k], 0) == &amp;quot;&amp;quot;);&lt;br /&gt;
        line += CheckResults(llList2String([i], 0) == (string)i, llList2String([i], 0) == &amp;quot;&amp;quot;);&lt;br /&gt;
        line += CheckResults(llList2String([f], 0) == (string)f, llList2String([f], 0) == &amp;quot;&amp;quot;);&lt;br /&gt;
        // we can&#039;t compare to (string)v because that returns 5 decimals in components instead of the usual 6&lt;br /&gt;
        line += CheckResults(llList2String([v], 0) == v2s(v),    llList2String([v], 0) == &amp;quot;&amp;quot;);&lt;br /&gt;
        // same caveat as above&lt;br /&gt;
        line += CheckResults(llList2String([r], 0) == r2s(r),    llList2String([r], 0) == &amp;quot;&amp;quot;);&lt;br /&gt;
        llOwnerSay(line);&lt;br /&gt;
&lt;br /&gt;
        line = &amp;quot;llList2Key        &amp;quot;;&lt;br /&gt;
        key expectedNo = llList2Key([], 0); // different expected negative result for Mono and LSO&lt;br /&gt;
        line += CheckResults(llList2Key([s], 0) == (key)s,           llList2Key([s], 0) == expectedNo);&lt;br /&gt;
        line += CheckResults(llList2Key([k], 0) == k,                llList2Key([k], 0) == expectedNo);&lt;br /&gt;
        line += CheckResults(llList2Key([i], 0) == (key)((string)i), llList2Key([i], 0) == expectedNo);&lt;br /&gt;
        line += CheckResults(llList2Key([f], 0) == (key)((string)f), llList2Key([f], 0) == expectedNo);&lt;br /&gt;
        line += CheckResults(llList2Key([v], 0) == (key)v2s(v),      llList2Key([v], 0) == expectedNo);&lt;br /&gt;
        line += CheckResults(llList2Key([r], 0) == (key)r2s(r),      llList2Key([r], 0) == expectedNo);&lt;br /&gt;
        llOwnerSay(line);&lt;br /&gt;
&lt;br /&gt;
        line = &amp;quot;llList2Integer &amp;quot;;&lt;br /&gt;
        s = &amp;quot;234&amp;quot;;&lt;br /&gt;
        k = (key)&amp;quot;234&amp;quot;;&lt;br /&gt;
        i = 234;&lt;br /&gt;
        f = 234.1;&lt;br /&gt;
        v = &amp;lt;234.0, 30.0, 20.0&amp;gt;;&lt;br /&gt;
        r = &amp;lt;1.0, 1.0, 1.0, 1.0&amp;gt;;&lt;br /&gt;
        line += CheckResults(llList2Integer([s], 0) == (integer)s,           llList2Integer([s], 0) == 0);&lt;br /&gt;
        line += CheckResults(llList2Integer([k], 0) == (integer)((string)k), llList2Integer([k], 0) == 0);&lt;br /&gt;
        line += CheckResults(llList2Integer([i], 0) == i,                    llList2Integer([i], 0) == 0);&lt;br /&gt;
        line += CheckResults(llList2Integer([f], 0) == (integer)f,           llList2Integer([f], 0) == 0);&lt;br /&gt;
        line += CheckResults(llList2Integer([v], 0) == (integer)v.x,         llList2Integer([v], 0) == 0);&lt;br /&gt;
        line += CheckResults(llList2Integer([r], 0) == (integer)r.x,         llList2Integer([r], 0) == 0);&lt;br /&gt;
        llOwnerSay(line);&lt;br /&gt;
&lt;br /&gt;
        line = &amp;quot;llList2Float     &amp;quot;;&lt;br /&gt;
        s = &amp;quot;234.1&amp;quot;;&lt;br /&gt;
        k = (key)&amp;quot;234.1&amp;quot;;&lt;br /&gt;
        i = 234;&lt;br /&gt;
        f = 234.1;&lt;br /&gt;
        v = &amp;lt;234.1, 30.0, 20.0&amp;gt;;&lt;br /&gt;
        r = &amp;lt;0.33, 0.66, 0.33, 0.589&amp;gt;;&lt;br /&gt;
        line += CheckResults(llList2Float([s], 0) == (float)s,           llList2Float([s], 0) == 0.0);&lt;br /&gt;
        line += CheckResults(llList2Float([k], 0) == (float)((string)k), llList2Float([k], 0) == 0.0);&lt;br /&gt;
        line += CheckResults(llList2Float([i], 0) == (float)i,           llList2Float([i], 0) == 0.0);&lt;br /&gt;
        line += CheckResults(llList2Float([f], 0) == f,                  llList2Float([f], 0) == 0.0);&lt;br /&gt;
        line += CheckResults(llList2Float([v], 0) == v.x,                llList2Float([v], 0) == 0.0);&lt;br /&gt;
        line += CheckResults(llList2Float([r], 0) == r.x,                llList2Float([r], 0) == 0.0);&lt;br /&gt;
        llOwnerSay(line);&lt;br /&gt;
&lt;br /&gt;
        line = &amp;quot;llList2Vector   &amp;quot;;&lt;br /&gt;
        s = &amp;quot;&amp;lt;1.3, 1.4, 1.5&amp;gt;&amp;quot;;&lt;br /&gt;
        k = (key)s;&lt;br /&gt;
        line += CheckResults(llList2Vector([s], 0) == (vector)s,           llList2Vector([s], 0) == ZERO_VECTOR);&lt;br /&gt;
        line += CheckResults(llList2Vector([k], 0) == (vector)((string)k), llList2Vector([k], 0) == ZERO_VECTOR);&lt;br /&gt;
        line += CheckResults(llList2Vector([i], 0) == &amp;lt;i, 0, 0&amp;gt;,           llList2Vector([i], 0) == ZERO_VECTOR);&lt;br /&gt;
        line += CheckResults(llList2Vector([f], 0) == &amp;lt;f, 0, 0&amp;gt;,           llList2Vector([f], 0) == ZERO_VECTOR);&lt;br /&gt;
        line += CheckResults(llList2Vector([v], 0) == v,                   llList2Vector([v], 0) == ZERO_VECTOR);&lt;br /&gt;
        line += CheckResults(llList2Vector([r], 0) == &amp;lt;r.x,r.y,r.z&amp;gt;,       llList2Vector([r], 0) == ZERO_VECTOR);&lt;br /&gt;
        llOwnerSay(line);&lt;br /&gt;
&lt;br /&gt;
        line = &amp;quot;llList2Rot        &amp;quot;;&lt;br /&gt;
        s = &amp;quot;&amp;lt;1.3, 1.4, 1.5, 1.6&amp;gt;&amp;quot;;&lt;br /&gt;
        k = (key)s;&lt;br /&gt;
        line += CheckResults(llList2Rot([s], 0) == (rotation)s,           llList2Rot([s], 0) == ZERO_ROTATION);&lt;br /&gt;
        line += CheckResults(llList2Rot([k], 0) == (rotation)((string)k), llList2Rot([k], 0) == ZERO_ROTATION);&lt;br /&gt;
        line += CheckResults(llList2Rot([i], 0) == &amp;lt;i, 0, 0, 0&amp;gt;,          llList2Rot([i], 0) == ZERO_ROTATION);&lt;br /&gt;
        line += CheckResults(llList2Rot([f], 0) == &amp;lt;f, 0, 0, 0&amp;gt;,          llList2Rot([f], 0) == ZERO_ROTATION);&lt;br /&gt;
        line += CheckResults(llList2Rot([v], 0) == &amp;lt;v.x, v.y, v.z, 0&amp;gt;,    llList2Rot([v], 0) == ZERO_ROTATION);&lt;br /&gt;
        line += CheckResults(llList2Rot([r], 0) == r,                     llList2Rot([r], 0) == ZERO_ROTATION);&lt;br /&gt;
        llOwnerSay(line);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Pedro_Oval/XorBase64StringsSameLength&amp;diff=1194729</id>
		<title>User:Pedro Oval/XorBase64StringsSameLength</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Pedro_Oval/XorBase64StringsSameLength&amp;diff=1194729"/>
		<updated>2015-01-24T04:43:47Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: &amp;lt;lsl&amp;gt; to &amp;lt;source&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Note|This function has been obsoleted by the release of [[llXorBase64]] in [[Release Notes/Second Life Server/13#13.06.21.277682|server version 13.06.21.277682]].}}&lt;br /&gt;
&lt;br /&gt;
This code works around a bug in [[llXorBase64StringsCorrect]] in order to perform correct XOR of two strings of the same length but without the 0.3 second delay included in [[llXorBase64Strings]]. It relies on [[llBase64ToInteger]]&#039;s unpredictable behaviour not affecting the bits actually used, for speed. It is a workaround to [http://jira.secondlife.com/browse/SCR-35 SCR-35] to provide a substitutive while that bug isn&#039;t fixed. Note that it is not a full substitutive for &amp;lt;code&amp;gt;llXorBase64StringsCorrect&amp;lt;/code&amp;gt;, because it doesn&#039;t deal with the case of the second string being shorter than the first. Its main purpose is stream encryption, where the lengths usually match or at least the second string is longer (that case will be correctly handled by this function, trimming the result to the length of the first string).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
string XorBase64StringsSameLength(string s1, string s2)&lt;br /&gt;
{&lt;br /&gt;
    integer i;&lt;br /&gt;
    string s3;&lt;br /&gt;
    integer len = llStringLength(s1); // assumed to be the same in s1 and s2&lt;br /&gt;
    integer pad = (llGetSubString(s1, -2, -2) == &amp;quot;=&amp;quot;) + (llGetSubString(s1, -1, -1) == &amp;quot;=&amp;quot;);&lt;br /&gt;
    for (i = 0; i &amp;lt; len; i += 4)&lt;br /&gt;
    {&lt;br /&gt;
        s3 += llGetSubString(llIntegerToBase64(llBase64ToInteger(llGetSubString(s1, i, i+3))&lt;br /&gt;
                                               ^ llBase64ToInteger(llGetSubString(s2, i, i+3))),&lt;br /&gt;
                             0, 3);&lt;br /&gt;
    }&lt;br /&gt;
    if (pad)&lt;br /&gt;
    {&lt;br /&gt;
        s3 = llGetSubString(s3, 0, -pad-1) + llGetSubString(&amp;quot;==&amp;quot;, -pad, -1);&lt;br /&gt;
    }&lt;br /&gt;
    return s3;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Test suite */&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay((string)llStringLength(XorBase64StringsSameLength(&amp;quot;&amp;quot;, &amp;quot;whatever&amp;quot;))); // Returns 0 as it should&lt;br /&gt;
        llOwnerSay(XorBase64StringsSameLength(&amp;quot;AABA&amp;quot;, &amp;quot;1234&amp;quot;)); // Returns 1224 as it should&lt;br /&gt;
        llOwnerSay(XorBase64StringsSameLength(&amp;quot;1234&amp;quot;, &amp;quot;AABA&amp;quot;)); // Returns 1224 as it should&lt;br /&gt;
&lt;br /&gt;
        llOwnerSay(XorBase64StringsSameLength(&amp;quot;BAAA&amp;quot;, &amp;quot;1234&amp;quot;)); // Returns 0234 as it should&lt;br /&gt;
        llOwnerSay(XorBase64StringsSameLength(&amp;quot;1234&amp;quot;, &amp;quot;BAAA&amp;quot;)); // Returns 0234 as it should&lt;br /&gt;
&lt;br /&gt;
        llOwnerSay(XorBase64StringsSameLength(&amp;quot;AABA&amp;quot;, &amp;quot;AABA&amp;quot;)); // Returns AAAA as it should&lt;br /&gt;
&lt;br /&gt;
        llOwnerSay(XorBase64StringsSameLength(&amp;quot;1234///=&amp;quot;, &amp;quot;1234AAA=&amp;quot;)); // Returns AAAA//8= as it should&lt;br /&gt;
        llOwnerSay(XorBase64StringsSameLength(&amp;quot;1234///=&amp;quot;, &amp;quot;1234AAA/&amp;quot;)); // Returns AAAA//8= as it should&lt;br /&gt;
        llOwnerSay(llXorBase64StringsCorrect (&amp;quot;1234///=&amp;quot;, &amp;quot;1234AAA=&amp;quot;)); // Returns AAAAKJI= (wrong)&lt;br /&gt;
        llOwnerSay(llXorBase64StringsCorrect (&amp;quot;1234AAA=&amp;quot;, &amp;quot;1234///=&amp;quot;)); // Returns AAAA//8= as it should&lt;br /&gt;
&lt;br /&gt;
        llOwnerSay(XorBase64StringsSameLength(&amp;quot;1234//==&amp;quot;, &amp;quot;1234AA==&amp;quot;)); // Returns AAAA/w== as it should&lt;br /&gt;
        llOwnerSay(XorBase64StringsSameLength(&amp;quot;1234//==&amp;quot;, &amp;quot;1234AA//&amp;quot;)); // Returns AAAA/w== as it should&lt;br /&gt;
        llOwnerSay(llXorBase64StringsCorrect (&amp;quot;1234//==&amp;quot;, &amp;quot;1234AA==&amp;quot;)); // Returns AAAAKA== (wrong)&lt;br /&gt;
        llOwnerSay(llXorBase64StringsCorrect (&amp;quot;1234AA==&amp;quot;, &amp;quot;1234//==&amp;quot;)); // Returns AAAA/w== as it should&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Pedro_Oval/Float_formatting_functions&amp;diff=1194728</id>
		<title>User:Pedro Oval/Float formatting functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Pedro_Oval/Float_formatting_functions&amp;diff=1194728"/>
		<updated>2015-01-24T04:39:27Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: &amp;lt;lsl&amp;gt; to &amp;lt;source&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== WARNING: WORK IN PROGRESS - NOT READY FOR USE YET ===&lt;br /&gt;
&lt;br /&gt;
This is a collection of functions for formatting floats with rounding, carefully tuned to get the expected results in most cases, something that other widely available functions often fail to accomplish. None of them will work with more than 6 decimals though.&lt;br /&gt;
&lt;br /&gt;
The variations are for slightly different purposes. Some can be a question of taste; others depend on functionality.&lt;br /&gt;
&lt;br /&gt;
The variants with the dot removed are good for human-readable formatted output, because it&#039;s prettier to see &amp;lt;code&amp;gt;&amp;quot;4&amp;quot;&amp;lt;/code&amp;gt; than to see &amp;lt;code&amp;gt;&amp;quot;4.&amp;quot;&amp;lt;/code&amp;gt;; if the output has to include the decimals mandatorily, &amp;lt;code&amp;gt;&amp;quot;4.0&amp;quot;&amp;lt;/code&amp;gt; is usually considered prettier than &amp;lt;code&amp;gt;&amp;quot;4.&amp;quot;&amp;lt;/code&amp;gt;. The variants that don&#039;t remove the dot are good e.g. for machine-generated code where the formatting is not important but the type is. (&amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt; is an integer; &amp;lt;code&amp;gt;4.&amp;lt;/code&amp;gt; is a float.) This may save an implicit type conversion at runtime where a float is expected but an integer is given, which just wastes memory and speed unnecessarily. For example, &amp;lt;code&amp;gt;&amp;amp;lt;1, 0, 0&amp;amp;gt;&amp;lt;/code&amp;gt; adds 3 type conversions to the code, but &amp;lt;code&amp;gt;&amp;amp;lt;1., 0., 0.&amp;amp;gt;&amp;lt;/code&amp;gt; doesn&#039;t add any extra burden.&lt;br /&gt;
&lt;br /&gt;
Pick your poison:&lt;br /&gt;
&lt;br /&gt;
== Just trim zeros at the end ==&lt;br /&gt;
&lt;br /&gt;
These functions take just one argument and return at most 6 decimals, with the zeros trimmed and rounded to the 6th decimal. For example, &amp;lt;code&amp;gt;FormatFloat(4.31)&amp;lt;/code&amp;gt; returns &amp;lt;code&amp;gt;&amp;quot;4.31&amp;quot;&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;&amp;quot;4.310000&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Dot removed if last character ===&lt;br /&gt;
&lt;br /&gt;
E.g. &amp;lt;code&amp;gt;FormatFloat(4.0)&amp;lt;/code&amp;gt; returns &amp;lt;code&amp;gt;&amp;quot;4&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Faster:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
string FormatFloat(float f)&lt;br /&gt;
{&lt;br /&gt;
    string fs = (string)f;&lt;br /&gt;
    if (fs == &amp;quot;-0.000000&amp;quot;) return &amp;quot;0&amp;quot;;&lt;br /&gt;
    if (llGetSubString(fs, -6, -1) == &amp;quot;000000&amp;quot; return llDeleteSubString(fs, -7, -1);&lt;br /&gt;
    if (llGetSubString(fs, -5, -1) == &amp;quot;00000&amp;quot; return llDeleteSubString(fs, -5, -1);&lt;br /&gt;
    if (llGetSubString(fs, -4, -1) == &amp;quot;0000&amp;quot; return llDeleteSubString(fs, -4, -1);&lt;br /&gt;
    if (llGetSubString(fs, -3, -1) == &amp;quot;000&amp;quot; return llDeleteSubString(fs, -3, -1);&lt;br /&gt;
    if (llGetSubString(fs, -2, -1) == &amp;quot;00&amp;quot; return llDeleteSubString(fs, -2, -1);&lt;br /&gt;
    if (llGetSubString(fs, -1, -1) == &amp;quot;0&amp;quot; return llDeleteSubString(fs, -1, -1);&lt;br /&gt;
    return fs;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shorter:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
string FormatFloat(float f)&lt;br /&gt;
{&lt;br /&gt;
    string fs = (string)f;&lt;br /&gt;
    if (fs == &amp;quot;-0.000000&amp;quot;) return &amp;quot;0&amp;quot;;&lt;br /&gt;
    integer i;&lt;br /&gt;
    string last;&lt;br /&gt;
    do ; while ((last = llGetSubString(fs, i=~-i, i)) == &amp;quot;0&amp;quot;);&lt;br /&gt;
    return llGetSubString(fs, 0, i - (last == &amp;quot;.&amp;quot;));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dot not removed if last character ===&lt;br /&gt;
&lt;br /&gt;
E.g. &amp;lt;code&amp;gt;FormatFloat(4.0)&amp;lt;/code&amp;gt; returns &amp;lt;code&amp;gt;&amp;quot;4.&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Faster:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
string FormatFloat(float f)&lt;br /&gt;
{&lt;br /&gt;
    string fs = (string)f;&lt;br /&gt;
    if (fs == &amp;quot;-0.000000&amp;quot;) return &amp;quot;0.&amp;quot;;&lt;br /&gt;
    if (llGetSubString(fs, -6, -1) == &amp;quot;000000&amp;quot; return llDeleteSubString(fs, -6, -1);&lt;br /&gt;
    if (llGetSubString(fs, -5, -1) == &amp;quot;00000&amp;quot; return llDeleteSubString(fs, -5, -1);&lt;br /&gt;
    if (llGetSubString(fs, -4, -1) == &amp;quot;0000&amp;quot; return llDeleteSubString(fs, -4, -1);&lt;br /&gt;
    if (llGetSubString(fs, -3, -1) == &amp;quot;000&amp;quot; return llDeleteSubString(fs, -3, -1);&lt;br /&gt;
    if (llGetSubString(fs, -2, -1) == &amp;quot;00&amp;quot; return llDeleteSubString(fs, -2, -1);&lt;br /&gt;
    if (llGetSubString(fs, -1, -1) == &amp;quot;0&amp;quot; return llDeleteSubString(fs, -1, -1);&lt;br /&gt;
    return fs;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shorter:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
string FormatFloat(float f)&lt;br /&gt;
{&lt;br /&gt;
    string fs = (string)f;&lt;br /&gt;
    if (fs == &amp;quot;-0.000000&amp;quot;) return &amp;quot;0.&amp;quot;;&lt;br /&gt;
    integer i;&lt;br /&gt;
    do ; while (llGetSubString(fs, (i=~-i), i) == &amp;quot;0&amp;quot;);&lt;br /&gt;
    return llGetSubString(fs, 0, i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 1 decimal minimum ===&lt;br /&gt;
&lt;br /&gt;
E.g. &amp;lt;code&amp;gt;FormatFloat(4.0)&amp;lt;/code&amp;gt; returns &amp;lt;code&amp;gt;&amp;quot;4.0&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Faster:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
string FormatFloat(float f)&lt;br /&gt;
{&lt;br /&gt;
    string fs = (string)f;&lt;br /&gt;
    if (fs == &amp;quot;-0.000000&amp;quot;) return &amp;quot;0.0&amp;quot;;&lt;br /&gt;
    if (llGetSubString(fs, -5, -1) == &amp;quot;00000&amp;quot; return llDeleteSubString(fs, -5, -1);&lt;br /&gt;
    if (llGetSubString(fs, -4, -1) == &amp;quot;0000&amp;quot; return llDeleteSubString(fs, -4, -1);&lt;br /&gt;
    if (llGetSubString(fs, -3, -1) == &amp;quot;000&amp;quot; return llDeleteSubString(fs, -3, -1);&lt;br /&gt;
    if (llGetSubString(fs, -2, -1) == &amp;quot;00&amp;quot; return llDeleteSubString(fs, -2, -1);&lt;br /&gt;
    if (llGetSubString(fs, -1, -1) == &amp;quot;0&amp;quot; return llDeleteSubString(fs, -1, -1);&lt;br /&gt;
    return fs;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Shorter:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
string FormatFloat(float f)&lt;br /&gt;
{&lt;br /&gt;
    string fs = (string)f;&lt;br /&gt;
    if (fs == &amp;quot;-0.000000&amp;quot;) return &amp;quot;0.0&amp;quot;;&lt;br /&gt;
    integer i;&lt;br /&gt;
    do ; while (i &amp;gt; -6 &amp;amp;&amp;amp; llGetSubString(fs, (i=~-i), i) == &amp;quot;0&amp;quot;);&lt;br /&gt;
    return llGetSubString(fs, 0, i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Fixed number of decimals ==&lt;br /&gt;
&lt;br /&gt;
These functions take two arguments: the float to format and the number of decimals. They perform rounding in the last digit. For example, &amp;lt;code&amp;gt;FormatFloat(4.361262, 4)&amp;lt;/code&amp;gt; returns &amp;lt;code&amp;gt;&amp;quot;4.3613&amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;FormatFloat(4.36, 4)&amp;lt;/code&amp;gt; returns &amp;lt;code&amp;gt;&amp;quot;4.3600&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Dot removed if zero decimals ===&lt;br /&gt;
&lt;br /&gt;
E.g. &amp;lt;code&amp;gt;FormatFloat(4.3, 0)&amp;lt;/code&amp;gt; returns &amp;lt;code&amp;gt;&amp;quot;4&amp;quot;&amp;lt;/code&amp;gt;; &amp;lt;code&amp;gt;FormatFloat(-4.6, 0)&amp;lt;/code&amp;gt; returns &amp;lt;code&amp;gt;&amp;quot;-5&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
string FormatFloat(float f, integer num_decimals)&lt;br /&gt;
{&lt;br /&gt;
    float rounding = (float)(&amp;quot;.5e-&amp;quot; + (string)num_decimals) - 0.0000005;&lt;br /&gt;
    if (f &amp;lt; 0.) f -= rounding; else f += rounding;&lt;br /&gt;
    string ret = llGetSubString((string)f, 0, num_decimals - !num_decimals - 7);&lt;br /&gt;
    if ((float)ret == 0. &amp;amp;&amp;amp; llGetSubString(ret, 0, 0) == &amp;quot;-&amp;quot;)&lt;br /&gt;
        ret = llDeleteSubString(ret, 0, 0);&lt;br /&gt;
    return ret;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dot not removed if zero decimals ===&lt;br /&gt;
&lt;br /&gt;
E.g. &amp;lt;code&amp;gt;FormatFloat(4.3, 0)&amp;lt;/code&amp;gt; returns &amp;lt;code&amp;gt;&amp;quot;4.&amp;quot;&amp;lt;/code&amp;gt;. This is the shortest version, recommended if you will never use zero decimals.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
string FormatFloat(float f, integer num_decimals)&lt;br /&gt;
{&lt;br /&gt;
    float rounding = (float)(&amp;quot;.5e-&amp;quot; + (string)num_decimals) - 0.0000005;&lt;br /&gt;
    if (f &amp;lt; 0.) f -= rounding; else f += rounding;&lt;br /&gt;
    string ret = llGetSubString((string)f, 0, num_decimals - 7);&lt;br /&gt;
    if ((float)ret == 0. &amp;amp;&amp;amp; llGetSubString(ret, 0, 0) == &amp;quot;-&amp;quot;)&lt;br /&gt;
        ret = llDeleteSubString(ret, 0, 0);&lt;br /&gt;
    return ret;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add .0 if zero decimals ===&lt;br /&gt;
&lt;br /&gt;
E.g. &amp;lt;code&amp;gt;FormatFloat(4.3, 0)&amp;lt;/code&amp;gt; returns &amp;lt;code&amp;gt;&amp;quot;4.0&amp;quot;&amp;lt;/code&amp;gt;. This can be unexpected and surprising for many users, so use it only if you are sure you need something like that.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
string FormatFloat(float f, integer num_decimals)&lt;br /&gt;
{&lt;br /&gt;
    float rounding = (float)(&amp;quot;.5e-&amp;quot; + (string)num_decimals) - 0.0000005;&lt;br /&gt;
    if (f &amp;lt; 0.0) f -= rounding; else f += rounding;&lt;br /&gt;
    string ret = llGetSubString((string)f, 0, num_decimals - 7);&lt;br /&gt;
    if ((float)ret == 0. &amp;amp;&amp;amp; llGetSubString(ret, 0, 0) == &amp;quot;-&amp;quot;)&lt;br /&gt;
        ret = llDeleteSubString(ret, 0, 0);&lt;br /&gt;
    if (! num_decimals) ret += &amp;quot;0&amp;quot;;&lt;br /&gt;
    return ret;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Fixed number of decimals, trimming trailing zeros ==&lt;br /&gt;
&lt;br /&gt;
This is an hybrid between both kinds of functions above. It limits the number of decimals output to the given maximum, but also trims zeros at the end, so it&#039;s possible to get less decimals than requested (but not more). For example, &amp;lt;code&amp;gt;FormatFloat(4.396, 2)&amp;lt;/code&amp;gt; returns &amp;lt;code&amp;gt;&amp;quot;4.4&amp;quot;&amp;lt;/code&amp;gt; because 4.396 rounded to two decimals is 4.40 and then the trailing zero is trimmed.&lt;br /&gt;
&lt;br /&gt;
=== Dot removed if zero decimals ===&lt;br /&gt;
&lt;br /&gt;
=== Dot not removed if zero decimals ===&lt;br /&gt;
&lt;br /&gt;
=== Add .0 if zero decimals ===&lt;br /&gt;
&lt;br /&gt;
== Test suite for all of the above ==&lt;br /&gt;
&lt;br /&gt;
The program below exercises some corner cases I could come up with, to ensure that the resuls are as expected. Many other float formatting functions fail some of these tests.&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Pedro_Oval/Uniform_random_rotation&amp;diff=1194727</id>
		<title>User:Pedro Oval/Uniform random rotation</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Pedro_Oval/Uniform_random_rotation&amp;diff=1194727"/>
		<updated>2015-01-24T04:35:15Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: &amp;lt;lsl&amp;gt; to &amp;lt;source&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Based on a &amp;quot;graphics gem&amp;quot; by Ken Shoemake [http://books.google.com/books?id=xmW_u3mQLmQC&amp;amp;pg=PA130]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
rotation UniformRandRot()&lt;br /&gt;
{&lt;br /&gt;
    // Method from Graphic Gems 3, &amp;quot;Uniform Random Rotations&amp;quot;&lt;br /&gt;
    // by Ken Shoemake, p.130&lt;br /&gt;
    float r2 = llFrand(1.0);&lt;br /&gt;
    float a1 = llFrand(TWO_PI);&lt;br /&gt;
    float a2 = llFrand(TWO_PI);&lt;br /&gt;
    float r1 = llSqrt(1.0 - r2);&lt;br /&gt;
    r2 = llSqrt(r2);&lt;br /&gt;
    return &amp;lt;r1*llSin(a1), r1*llCos(a1), r2*llSin(a2), r2*llCos(a2)&amp;gt;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Pedro_Oval/Calculate_rotation_for_pointing_in_a_direction&amp;diff=1194726</id>
		<title>User:Pedro Oval/Calculate rotation for pointing in a direction</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Pedro_Oval/Calculate_rotation_for_pointing_in_a_direction&amp;diff=1194726"/>
		<updated>2015-01-24T04:31:00Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: &amp;lt;lsl&amp;gt; to &amp;lt;source&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here are two functions that, given a [[vector]] to point at, return the [[rotation]] that corresponds to that vector.&lt;br /&gt;
&lt;br /&gt;
One of the functions, &amp;lt;code&amp;gt;PointAt2Rot&amp;lt;/code&amp;gt;, makes the forward (X) vector point exactly in that direction, while keeping the up (Z) vector pointing &amp;quot;as up as possible&amp;quot; and the left (Y) vector completely horizontal. It is similar to what [[llLookAt]] does, except that the vector that points to the target is X (forward) instead of Z (up), and the result is a rotation, not a continuously updating state of pointing in the given direction. A similar result can be obtained by combining these functions with [[llRotLookAt]].&lt;br /&gt;
&lt;br /&gt;
The other function, &amp;lt;code&amp;gt;PointAtHoriz2Rot&amp;lt;/code&amp;gt;, points to the horizontal that is closest to the given vector, while the up vector points exactly up. It is useful if the final resulting rotation must be horizontal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Written by Pedro Oval, 2011-01-11&lt;br /&gt;
&lt;br /&gt;
rotation PointAt2Rot(vector target)&lt;br /&gt;
{&lt;br /&gt;
    vector left = llVecNorm(&amp;lt;0,0,1&amp;gt; % target);&lt;br /&gt;
    target = llVecNorm(target);&lt;br /&gt;
    return llAxes2Rot(target, left, target % left);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
rotation PointAtHoriz2Rot(vector target)&lt;br /&gt;
{&lt;br /&gt;
    // Find the Z angle and halve it for the quaternion:&lt;br /&gt;
    target.z = llAtan2(target.y, target.x) * 0.5;&lt;br /&gt;
    // Make a quaternion out of it on z:&lt;br /&gt;
    return &amp;lt;0, 0, llSin(target.z), llCos(target.z)&amp;gt;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following are versions of &amp;lt;code&amp;gt;PointAt2Rot&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;PointAtHoriz2Rot&amp;lt;/code&amp;gt; that allow a viewup vector (the vector that determines the tilting) expressed in the same coordinate system as the target vector:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
// Written by Pedro Oval, 2011-01-08&lt;br /&gt;
&lt;br /&gt;
rotation PointAtViewup2Rot(vector target, vector viewup)&lt;br /&gt;
{&lt;br /&gt;
    // Reuse the variables to avoid declaring locals, which is expensive&lt;br /&gt;
    viewup = llVecNorm(viewup % target);&lt;br /&gt;
    target = llVecNorm(target);&lt;br /&gt;
    return llAxes2Rot(target, viewup, target % viewup);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
rotation PointAtHorizViewup2Rot(vector target, vector viewup)&lt;br /&gt;
{&lt;br /&gt;
    // Reuse the variables to avoid declaring locals, which is expensive&lt;br /&gt;
    target = llVecNorm(viewup % target);&lt;br /&gt;
    viewup = llVecNorm(viewup);&lt;br /&gt;
    return llAxes2Rot(target % viewup, target, viewup);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When these two functions are passed a viewup of &amp;lt;code&amp;gt;&amp;amp;lt;0, 0, 1&amp;amp;gt;&amp;lt;/code&amp;gt;, they return the same result as the former two (except for possible precision issues).&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
The following are incomplete examples, as they need the above functions included, which have been stripped for brevity and ease of maintenance.&lt;br /&gt;
&lt;br /&gt;
This example uses a 0.5 second sensor to detect a nearby prim called &#039;&#039;Target&#039;&#039; and makes the current prim&#039;s X axis point to it (assuming it&#039;s in a prim alone, or in the root of a linked set):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSensorRepeat(&amp;quot;Target&amp;quot;, &amp;quot;&amp;quot;, ACTIVE | PASSIVE, 30., PI, 0.5);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    sensor(integer num)&lt;br /&gt;
    {&lt;br /&gt;
        llSetRot(PointAt2Rot(llDetectedPos(0) - llGetPos()));&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changing &amp;lt;code&amp;gt;PointAt2Rot&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;PointAtHoriz2Rot&amp;lt;/code&amp;gt; in the above will make the prim be always horizontal but with its X face facing the target as much as possible while keeping the horizontal.&lt;br /&gt;
&lt;br /&gt;
The following example shows how to use &amp;lt;code&amp;gt;PointAtViewup2Rot&amp;lt;/code&amp;gt; to orient the prim&#039;s top in world coordinates, when the script is used within a linked prim. It is assumed to be in a prim with a link number greater than 2. It detects the position of the prim with link number 2 using a timer, and makes this prim&#039;s X axis point towards it, and the Z axis as close to the world&#039;s up vector as possible:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetTimerEvent(0.5);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        rotation RootRot = llGetRootRotation();&lt;br /&gt;
&lt;br /&gt;
        // Get the target prim&#039;s position in world coordinates.&lt;br /&gt;
        vector pos = llList2Vector(llGetLinkPrimitiveParams(2, [PRIM_POSITION]), 0);&lt;br /&gt;
&lt;br /&gt;
        // Use the world&#039;s &amp;lt;0, 0, 1&amp;gt; vector as viewup, after converting it&lt;br /&gt;
        // to local coordinates, and the vector from our position to the target&lt;br /&gt;
        // as the PointAt, also in local coordinates:&lt;br /&gt;
        llSetLocalRot(PointAtViewup2Rot((pos - llGetPos()) / RootRot, &amp;lt;0, 0, 1&amp;gt; / RootRot));&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Pedro_Oval/Base64_HMAC_SHA-1&amp;diff=1194725</id>
		<title>User:Pedro Oval/Base64 HMAC SHA-1</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Pedro_Oval/Base64_HMAC_SHA-1&amp;diff=1194725"/>
		<updated>2015-01-24T04:29:34Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: &amp;lt;lsl&amp;gt; to &amp;lt;source&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;TODO: Add some text here, add padding test vectors&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
string HexToBase64Unpadded(string a)&lt;br /&gt;
{&lt;br /&gt;
    integer i = 0;&lt;br /&gt;
    integer len = llStringLength(a += &amp;quot;0000&amp;quot;) - 4;&lt;br /&gt;
    string res = &amp;quot;&amp;quot;;&lt;br /&gt;
    while (i &amp;lt; len)&lt;br /&gt;
    {&lt;br /&gt;
        res += llGetSubString(llIntegerToBase64(4*(integer)(&amp;quot;0x&amp;quot; + llGetSubString(a, i, i+5))), 1, 4);&lt;br /&gt;
        i += 6;&lt;br /&gt;
    }&lt;br /&gt;
    return llGetSubString(res, 0, len*2/3);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string RemovePadding(string b64) // specialized - it won&#039;t work if the string consists of all &amp;quot;=&amp;quot;&lt;br /&gt;
{&lt;br /&gt;
    integer i;&lt;br /&gt;
    do ; while(llGetSubString(b64, i = ~-i, i) == &amp;quot;=&amp;quot;);&lt;br /&gt;
    return llGetSubString(b64, 0, i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
list Base64SHA1Compress(string b64, integer H1, integer H2, integer H3, integer H4, integer H5, integer i)&lt;br /&gt;
{&lt;br /&gt;
    integer A = H1;&lt;br /&gt;
    integer B = H2;&lt;br /&gt;
    integer C = H3;&lt;br /&gt;
    integer D = H4;&lt;br /&gt;
    integer E = H5;&lt;br /&gt;
&lt;br /&gt;
    integer round;&lt;br /&gt;
    integer S = 0;&lt;br /&gt;
    integer T;&lt;br /&gt;
    list x = [];&lt;br /&gt;
    string buf;&lt;br /&gt;
&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        T = llBase64ToInteger(buf = llGetSubString(b64, T = ((i + round) &amp;lt;&amp;lt; 4) / 3, T+6)) &amp;lt;&amp;lt; (S = ((i + round) % 3) &amp;lt;&amp;lt; 1);&lt;br /&gt;
        if(S)&lt;br /&gt;
            T = T | (llBase64ToInteger(&amp;quot;A&amp;quot; + (llDeleteSubString(buf, 0, 1))) &amp;gt;&amp;gt; (6 - S));&lt;br /&gt;
//            llOwnerSay(&amp;quot;W[&amp;quot;+(string)round+&amp;quot;]=&amp;quot;+hex(T));&lt;br /&gt;
        x += T;&lt;br /&gt;
        T += ((A &amp;lt;&amp;lt; 5) | ((A &amp;gt;&amp;gt; 27) &amp;amp; 0x1F)) + (D ^ (B &amp;amp; (C ^ D))) + E + 0x5a827999;&lt;br /&gt;
        E = D;&lt;br /&gt;
        D = C;&lt;br /&gt;
        C = ((B &amp;lt;&amp;lt; 30) | ((B &amp;gt;&amp;gt; 2) &amp;amp; 0x3FFFFFFF));&lt;br /&gt;
        B = A;&lt;br /&gt;
        A = T;&lt;br /&gt;
    }while(16 &amp;gt; (round = -~round));&lt;br /&gt;
//        llOwnerSay(llList2CSV(hexm(x)));&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        S = llList2Integer(x,  -3) ^ llList2Integer(x,  -8) ^ llList2Integer(x, -14) ^ llList2Integer(x, -16);&lt;br /&gt;
        x = llList2List(x + (T = ((S &amp;lt;&amp;lt; 1) | !!(S &amp;amp; 0x80000000))), -16, -1);&lt;br /&gt;
//            llOwnerSay(&amp;quot;W[&amp;quot;+(string)round+&amp;quot;]=&amp;quot;+hex(T));&lt;br /&gt;
        T += ((A &amp;lt;&amp;lt; 5) | ((A &amp;gt;&amp;gt; 27) &amp;amp; 0x1F)) + (D ^ (B &amp;amp; (C ^ D))) + E + 0x5a827999;&lt;br /&gt;
        E = D;&lt;br /&gt;
        D = C;&lt;br /&gt;
        C = ((B &amp;lt;&amp;lt; 30) | ((B &amp;gt;&amp;gt; 2) &amp;amp; 0x3FFFFFFF));&lt;br /&gt;
        B = A;&lt;br /&gt;
        A = T;&lt;br /&gt;
    }while(20 &amp;gt; (round = -~round));&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        S = llList2Integer(x,  -3) ^ llList2Integer(x,  -8) ^ llList2Integer(x, -14) ^ llList2Integer(x, -16);&lt;br /&gt;
        x = llList2List(x + (T = ((S &amp;lt;&amp;lt; 1) | !!(S &amp;amp; 0x80000000))), -16, -1);&lt;br /&gt;
//            llOwnerSay(&amp;quot;W[&amp;quot;+(string)round+&amp;quot;]=&amp;quot;+hex(T));&lt;br /&gt;
        T += ((A &amp;lt;&amp;lt; 5) | ((A &amp;gt;&amp;gt; 27) &amp;amp; 0x1F)) + (B ^ C ^ D) + E + 0x6ed9eba1;&lt;br /&gt;
        E = D;&lt;br /&gt;
        D = C;&lt;br /&gt;
        C = ((B &amp;lt;&amp;lt; 30) | ((B &amp;gt;&amp;gt; 2) &amp;amp; 0x3FFFFFFF));&lt;br /&gt;
        B = A;&lt;br /&gt;
        A = T;&lt;br /&gt;
    }while(40 &amp;gt; (round = -~round));&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        S = llList2Integer(x,  -3) ^ llList2Integer(x,  -8) ^ llList2Integer(x, -14) ^ llList2Integer(x, -16);&lt;br /&gt;
        x = llList2List(x + (T = ((S &amp;lt;&amp;lt; 1) | !!(S &amp;amp; 0x80000000))), -16, -1);&lt;br /&gt;
//            llOwnerSay(&amp;quot;W[&amp;quot;+(string)round+&amp;quot;]=&amp;quot;+hex(T));&lt;br /&gt;
        T += ((A &amp;lt;&amp;lt; 5) | ((A &amp;gt;&amp;gt; 27) &amp;amp; 0x1F)) + ((B &amp;amp; C) | (B &amp;amp; D) | (C &amp;amp; D)) + E + 0x8f1bbcdc;&lt;br /&gt;
        E = D;&lt;br /&gt;
        D = C;&lt;br /&gt;
        C = ((B &amp;lt;&amp;lt; 30) | ((B &amp;gt;&amp;gt; 2) &amp;amp; 0x3FFFFFFF));&lt;br /&gt;
        B = A;&lt;br /&gt;
        A = T;&lt;br /&gt;
    }while(60 &amp;gt; (round = -~round));&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        S = llList2Integer(x,  -3) ^ llList2Integer(x,  -8) ^ llList2Integer(x, -14) ^ llList2Integer(x, -16);&lt;br /&gt;
        x = llList2List(x + (T = ((S &amp;lt;&amp;lt; 1) | !!(S &amp;amp; 0x80000000))), -16, -1);&lt;br /&gt;
//            llOwnerSay(&amp;quot;W[&amp;quot;+(string)round+&amp;quot;]=&amp;quot;+hex(T));&lt;br /&gt;
        T += ((A &amp;lt;&amp;lt; 5) | ((A &amp;gt;&amp;gt; 27) &amp;amp; 0x1F)) + (B ^ C ^ D) + E + 0xca62c1d6;&lt;br /&gt;
        E = D;&lt;br /&gt;
        D = C;&lt;br /&gt;
        C = ((B &amp;lt;&amp;lt; 30) | ((B &amp;gt;&amp;gt; 2) &amp;amp; 0x3FFFFFFF));&lt;br /&gt;
        B = A;&lt;br /&gt;
        A = T;&lt;br /&gt;
    }while(80 &amp;gt; (round = -~round));&lt;br /&gt;
&lt;br /&gt;
    return [H1+A, H2+B, H3+C, H4+D, H5+E];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string Base64SHA1forHMAC(string b64, integer bit_length, integer extra_bit_length, integer H1, integer H2, integer H3, integer H4, integer H5)&lt;br /&gt;
{&lt;br /&gt;
    //OR on the extra bit.&lt;br /&gt;
    integer b = ((bit_length + 40) &amp;gt;&amp;gt; 5) | 15;&lt;br /&gt;
    integer T = llBase64ToInteger(RemovePadding(llGetSubString(b64, -4, -1)) + &amp;quot;AAAA&amp;quot;);&lt;br /&gt;
    string buf = &amp;quot;AAA&amp;quot;;&lt;br /&gt;
    integer i = -5;&lt;br /&gt;
    do buf += buf; while((i = -~i));&lt;br /&gt;
    if(bit_length)&lt;br /&gt;
    {&lt;br /&gt;
        i = 0x800000;&lt;br /&gt;
        if(!(bit_length % 24))&lt;br /&gt;
            i = 0x80;&lt;br /&gt;
        else if((bit_length % 24) == 16)&lt;br /&gt;
            i = 0x8000;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
        T = 0x80000000;//T is corrupt because of https://jira.secondlife.com/browse/SVC-104&lt;br /&gt;
    bit_length += extra_bit_length;&lt;br /&gt;
//    llOwnerSay(llList2CSV([i,bit_length]));&lt;br /&gt;
    b64 = llGetSubString( llDeleteSubString(b64, -4, -1) + &lt;br /&gt;
                          llGetSubString(llIntegerToBase64(T | i), 0, 5) + &lt;br /&gt;
                          buf, 0, (b &amp;lt;&amp;lt; 4) / 3) + &lt;br /&gt;
          llIntegerToBase64(bit_length &amp;lt;&amp;lt; (6 - ((b % 3) &amp;lt;&amp;lt; 1)));&lt;br /&gt;
    list x;&lt;br /&gt;
    i = 0;&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        x = Base64SHA1Compress(b64, H1, H2, H3, H4, H5, i);&lt;br /&gt;
        H1 = llList2Integer(x, 0);&lt;br /&gt;
        H2 = llList2Integer(x, 1);&lt;br /&gt;
        H3 = llList2Integer(x, 2);&lt;br /&gt;
        H4 = llList2Integer(x, 3);&lt;br /&gt;
        H5 = llList2Integer(x, 4);&lt;br /&gt;
    }while(b &amp;gt; (i += 16));&lt;br /&gt;
    x = [H1, H2, H3, H4, H5];&lt;br /&gt;
    i = -5;&lt;br /&gt;
    buf = &amp;quot;&amp;quot;;&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        T = llList2Integer(x,i);&lt;br /&gt;
        bit_length = 32;&lt;br /&gt;
        do&lt;br /&gt;
            buf += llGetSubString(&amp;quot;0123456789abcdef&amp;quot;, b = ((T &amp;gt;&amp;gt; (bit_length -= 4)) &amp;amp; 0xF), b);&lt;br /&gt;
        while (bit_length);&lt;br /&gt;
    }while ((i = -~i));&lt;br /&gt;
    return buf;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// The Real Thing&lt;br /&gt;
string Base64_HMAC_SHA1(string B64Key, string B64Data)&lt;br /&gt;
{&lt;br /&gt;
//    integer H1 = 0x67452301;&lt;br /&gt;
//    integer H2 = 0xefcdab89;&lt;br /&gt;
//    integer H3 = 0x98badcfe;&lt;br /&gt;
//    integer H4 = 0x10325476;&lt;br /&gt;
//    integer H5 = 0xc3d2e1f0;&lt;br /&gt;
    integer bit_length = llSubStringIndex(B64Key, &amp;quot;=&amp;quot;);&lt;br /&gt;
    if (!~bit_length)&lt;br /&gt;
    {&lt;br /&gt;
        bit_length = llStringLength(B64Key);&lt;br /&gt;
    }&lt;br /&gt;
    if (bit_length &amp;gt; 86)&lt;br /&gt;
    {&lt;br /&gt;
        // Use a hash of the key instead as a key&lt;br /&gt;
        B64Key = HexToBase64Unpadded(Base64SHA1forHMAC(B64Key, (bit_length*6)&amp;amp;-8, 0, 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0));&lt;br /&gt;
        bit_length = 27;&lt;br /&gt;
    }&lt;br /&gt;
    B64Key = llGetSubString(B64Key, 0, bit_length-1);&lt;br /&gt;
    string buf = &amp;quot;AAA&amp;quot;;&lt;br /&gt;
    integer i = -5;&lt;br /&gt;
    do buf += buf; while((i = -~i));&lt;br /&gt;
    B64Key = llXorBase64StringsCorrect(llGetSubString(B64Key + buf, 0, 85) + &amp;quot;==&amp;quot;, &amp;quot;NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2Ng==&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    list x = Base64SHA1Compress(B64Key, 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0, 0);&lt;br /&gt;
    bit_length = (6 * !(B64Data==&amp;quot;&amp;quot;) * (llStringLength(B64Data)-4+llStringLength(RemovePadding(llGetSubString(B64Data,-4,-1))))) &amp;amp; -8;&lt;br /&gt;
    B64Data = HexToBase64Unpadded(Base64SHA1forHMAC(B64Data, bit_length, 512, llList2Integer(x, 0), llList2Integer(x, 1), llList2Integer(x, 2), llList2Integer(x, 3), llList2Integer(x, 4))) + &amp;quot;=&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    // Xor with Base64(chr(0x36 xor 0x5C) * 64)&lt;br /&gt;
    B64Key = llXorBase64StringsCorrect(B64Key, &amp;quot;ampqampqampqampqampqampqampqampqampqampqampqampqampqampqampqampqampqampqampqampqampqag==&amp;quot;);&lt;br /&gt;
    x = Base64SHA1Compress(B64Key, 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0, 0);&lt;br /&gt;
    bit_length = 160;&lt;br /&gt;
    return Base64SHA1forHMAC(B64Data, bit_length, 512, llList2Integer(x, 0), llList2Integer(x, 1), llList2Integer(x, 2), llList2Integer(x, 3), llList2Integer(x, 4));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
test_vector_SHA1(string B64Key, string B64Data, string HexHash)&lt;br /&gt;
{&lt;br /&gt;
    llResetTime();&lt;br /&gt;
    string hmac = Base64_HMAC_SHA1(B64Key, B64Data);&lt;br /&gt;
    if (hmac != HexHash)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;HMAC-SHA1 test failed.\nComputed: &amp;quot; + hmac + &amp;quot;\nExpected : &amp;quot; + HexHash);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;HMAC-SHA1 test passed in &amp;quot; + (string)llGetTime() + &amp;quot; seconds.&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // RFC 2202 test vectors:&lt;br /&gt;
&lt;br /&gt;
        test_vector_SHA1(HexToBase64Unpadded(&amp;quot;0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b&amp;quot;) + &amp;quot;=&amp;quot;,&lt;br /&gt;
                         llStringToBase64(&amp;quot;Hi There&amp;quot;),&lt;br /&gt;
                         &amp;quot;b617318655057264e28bc0b6fb378c8ef146be00&amp;quot;);&lt;br /&gt;
        test_vector_SHA1(llStringToBase64(&amp;quot;Jefe&amp;quot;),&lt;br /&gt;
                         llStringToBase64(&amp;quot;what do ya want for nothing?&amp;quot;),&lt;br /&gt;
                         &amp;quot;effcdf6ae5eb2fa2d27416d5f184df9c259a7c79&amp;quot;);&lt;br /&gt;
        test_vector_SHA1(&amp;quot;qqqqqqqqqqqqqqqqqqqqqqqqqqo=&amp;quot;,&lt;br /&gt;
                         &amp;quot;3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d0=&amp;quot;,&lt;br /&gt;
                         &amp;quot;125d7342b9ac11cd91a39af48aa17b4f63f175d3&amp;quot;);&lt;br /&gt;
        test_vector_SHA1(HexToBase64Unpadded(&amp;quot;0102030405060708090a0b0c0d0e0f10111213141516171819&amp;quot;)+&amp;quot;==&amp;quot;,&lt;br /&gt;
                         HexToBase64Unpadded(&amp;quot;cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd&amp;quot;)+&amp;quot;=&amp;quot;,&lt;br /&gt;
                         &amp;quot;4c9007f4026250c6bc8414f9bf50c86c2d7235da&amp;quot;);&lt;br /&gt;
        test_vector_SHA1(HexToBase64Unpadded(&amp;quot;0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c&amp;quot;) + &amp;quot;=&amp;quot;,&lt;br /&gt;
                         llStringToBase64(&amp;quot;Test With Truncation&amp;quot;),&lt;br /&gt;
                         &amp;quot;4c1a03424b55e07fe7f27be1d58bb9324a9a5a04&amp;quot;);&lt;br /&gt;
        string buf = &amp;quot;aaaaa&amp;quot;;&lt;br /&gt;
        buf += buf;&lt;br /&gt;
        buf += buf;&lt;br /&gt;
        buf += buf;&lt;br /&gt;
        buf += buf;&lt;br /&gt;
        buf += buf;&lt;br /&gt;
        test_vector_SHA1(HexToBase64Unpadded(buf) + &amp;quot;=&amp;quot;,&lt;br /&gt;
                         llStringToBase64(&amp;quot;Test Using Larger Than Block-Size Key - Hash Key First&amp;quot;),&lt;br /&gt;
                         &amp;quot;aa4ae5e15272d00e95705637ce8a3b55ed402112&amp;quot;);&lt;br /&gt;
        test_vector_SHA1(HexToBase64Unpadded(buf) + &amp;quot;=&amp;quot;,&lt;br /&gt;
                        llStringToBase64(&amp;quot;Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data&amp;quot;),&lt;br /&gt;
                        &amp;quot;e8e99d0f45237d786d6bbaa7965c7808bbff1a91&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        // Test vector added by the author&lt;br /&gt;
        test_vector_SHA1(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;fbdb1d1b18aa6c08324b7d64b71fb76370690e1d&amp;quot;);&lt;br /&gt;
        // Test vectors added by the author for zero-terminated data strings at different padding positions&lt;br /&gt;
        // (generated with an independent program written in PHP):&lt;br /&gt;
        test_vector_SHA1(&amp;quot;blah&amp;quot;, &amp;quot;&amp;quot;,         &amp;quot;cf63ad15d4e1d7cdc33cb0084e362afe60d047b1&amp;quot;); // &amp;quot;&amp;quot;&lt;br /&gt;
        test_vector_SHA1(&amp;quot;blah&amp;quot;, &amp;quot;AA==&amp;quot;,     &amp;quot;36cda2fc2a348a0b3645a9c135a12118e6f4dcca&amp;quot;); // &amp;quot;\0&amp;quot;&lt;br /&gt;
        test_vector_SHA1(&amp;quot;blah&amp;quot;, &amp;quot;AAA=&amp;quot;,     &amp;quot;7b6527796c885a794f695541b4ec1a5af28dec3e&amp;quot;); // &amp;quot;\0\0&amp;quot;&lt;br /&gt;
        test_vector_SHA1(&amp;quot;blah&amp;quot;, &amp;quot;AAAA&amp;quot;,     &amp;quot;d79915ec627764b7092ec66036fcaf94e4d94091&amp;quot;); // &amp;quot;\0\0\0&amp;quot;&lt;br /&gt;
        test_vector_SHA1(&amp;quot;blah&amp;quot;, &amp;quot;MQA=&amp;quot;,     &amp;quot;9fa63e8684813ca6f601e7e082fd989c72295019&amp;quot;); // &amp;quot;1\0&amp;quot;&lt;br /&gt;
        test_vector_SHA1(&amp;quot;blah&amp;quot;, &amp;quot;MQAA&amp;quot;,     &amp;quot;0d1ad14b1c4da14d5fca5b2e3486a7df2ef5fa12&amp;quot;); // &amp;quot;1\0\0&amp;quot;&lt;br /&gt;
        test_vector_SHA1(&amp;quot;blah&amp;quot;, &amp;quot;MQAAAA==&amp;quot;, &amp;quot;29ba52e7d932fdb2854cf52f75dea30aa0773025&amp;quot;); // &amp;quot;1\0\0\0&amp;quot;&lt;br /&gt;
        test_vector_SHA1(&amp;quot;blah&amp;quot;, &amp;quot;MTIA&amp;quot;,     &amp;quot;ee65d68cdba172a95b7cc1640573bfa4f10fcf9d&amp;quot;); // &amp;quot;12\0&amp;quot;&lt;br /&gt;
        test_vector_SHA1(&amp;quot;blah&amp;quot;, &amp;quot;MTIAAA==&amp;quot;, &amp;quot;4908fdece951bc779690565b54960a5e93119d56&amp;quot;); // &amp;quot;12\0\0&amp;quot;&lt;br /&gt;
        test_vector_SHA1(&amp;quot;blah&amp;quot;, &amp;quot;MTIAAAA=&amp;quot;, &amp;quot;3213b2e563af1d5c04159bfcee0ee81124aaefb7&amp;quot;); // &amp;quot;12\0\0\0&amp;quot;&lt;br /&gt;
        test_vector_SHA1(&amp;quot;blah&amp;quot;, &amp;quot;MTIzAA==&amp;quot;, &amp;quot;f3967f44b64b8a32b3d0c9cfe514e580aca6869d&amp;quot;); // &amp;quot;123\0&amp;quot;&lt;br /&gt;
        test_vector_SHA1(&amp;quot;blah&amp;quot;, &amp;quot;MTIzAAA=&amp;quot;, &amp;quot;e509dfb925f1bd533216ba1f44d3ba1a998d078c&amp;quot;); // &amp;quot;123\0\0&amp;quot;&lt;br /&gt;
        test_vector_SHA1(&amp;quot;blah&amp;quot;, &amp;quot;MTIzAAAA&amp;quot;, &amp;quot;06476a68a5c2c6cfc5c595b83dcc672e910a3e3e&amp;quot;); // &amp;quot;123\0\0\0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        llOwnerSay(&amp;quot;End of tests.&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Pedro_Oval/Base64_HMAC_MD5&amp;diff=1194724</id>
		<title>User:Pedro Oval/Base64 HMAC MD5</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Pedro_Oval/Base64_HMAC_MD5&amp;diff=1194724"/>
		<updated>2015-01-24T04:28:58Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: &amp;lt;lsl&amp;gt; to &amp;lt;source&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;MD5 core written by [[User:Strife Onizuka|Strife Onizuka]]. HMAC calculation function, test vectors function and testcases, and modifications to Base64_MD5 made by [[User:Pedro Oval|Pedro Oval]]. Also, added functions HexToBase64Unpadded and RemovePadding, written by [[User:Pedro Oval|Pedro Oval]]. Modifications to Base64_MD5 comprise:&lt;br /&gt;
&lt;br /&gt;
* Accept base64 strings instead of plain text strings.&lt;br /&gt;
* Accept an initial input state.&lt;br /&gt;
* Accept an extra bitlength to consider as already added.&lt;br /&gt;
* Separated into compression function and padding function, to avoid the costly Base64 bitshift that would be needed otherwise.&lt;br /&gt;
* Renamed globals to minimize the risk of a collision with usercode.&lt;br /&gt;
* Fixed bug with data ending in zeros.&lt;br /&gt;
&lt;br /&gt;
Best speed seen under Mono: 0.201365 seconds for test case 15; worst: 0.495030 for test case 5.&lt;br /&gt;
Best speed seen under LSO : 5.698544 seconds for test case 19; worst: 13.351786 seconds for test case 7.&lt;br /&gt;
&lt;br /&gt;
All test cases pass with both LSO and Mono.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
string HexToBase64Unpadded(string a)&lt;br /&gt;
{&lt;br /&gt;
    integer i = 0;&lt;br /&gt;
    integer len = llStringLength(a += &amp;quot;0000&amp;quot;) - 4;&lt;br /&gt;
    string res = &amp;quot;&amp;quot;;&lt;br /&gt;
    while (i &amp;lt; len)&lt;br /&gt;
    {&lt;br /&gt;
        res += llGetSubString(llIntegerToBase64(4*(integer)(&amp;quot;0x&amp;quot; + llGetSubString(a, i, i+5))), 1, 4);&lt;br /&gt;
        i += 6;&lt;br /&gt;
    }&lt;br /&gt;
    return llGetSubString(res, 0, len*2/3);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string RemovePadding(string b64) // specialized - it won&#039;t work if the string consists of all &amp;quot;=&amp;quot;&lt;br /&gt;
{&lt;br /&gt;
    integer i;&lt;br /&gt;
    do ; while(llGetSubString(b64, i = ~-i, i) == &amp;quot;=&amp;quot;);&lt;br /&gt;
    return llGetSubString(b64, 0, i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string hexc=&amp;quot;0123456789abcdef&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
list MD5_r1 = [7, 12, 17, 22];&lt;br /&gt;
list MD5_r2 = [5,  9, 14, 20];&lt;br /&gt;
list MD5_r3 = [4, 11, 16, 23];&lt;br /&gt;
list MD5_r4 = [6, 10, 15, 21];&lt;br /&gt;
&lt;br /&gt;
list MD5_k1 = [&lt;br /&gt;
    0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501,&lt;br /&gt;
    0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be, 0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821];&lt;br /&gt;
list MD5_k2 = [&lt;br /&gt;
    0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa, 0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8,&lt;br /&gt;
    0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed, 0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a];&lt;br /&gt;
list MD5_k3 = [&lt;br /&gt;
    0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c, 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70,&lt;br /&gt;
    0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x04881d05, 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665];&lt;br /&gt;
list MD5_k4 = [&lt;br /&gt;
    0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039, 0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1,&lt;br /&gt;
    0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1, 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
list Base64MD5Compress(string b64, integer H1, integer H2, integer H3, integer H4, integer i)&lt;br /&gt;
{&lt;br /&gt;
    integer A = H1;&lt;br /&gt;
    integer B = H2;&lt;br /&gt;
    integer C = H3;&lt;br /&gt;
    integer D = H4;&lt;br /&gt;
    integer round = 0;&lt;br /&gt;
    list x = [];&lt;br /&gt;
    string buf;&lt;br /&gt;
    integer S = 0;&lt;br /&gt;
    integer T;&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        T = llBase64ToInteger(buf = llGetSubString(b64, T = ((i + round) &amp;lt;&amp;lt; 4) / 3, T+6)) &amp;lt;&amp;lt; (S = (((i + round) % 3) &amp;lt;&amp;lt; 1));&lt;br /&gt;
        if(S)&lt;br /&gt;
            T = T | (llBase64ToInteger(&amp;quot;A&amp;quot; + (llDeleteSubString(buf, 0, 1))) &amp;gt;&amp;gt; (6 - S));&lt;br /&gt;
        x += (T = ((T &amp;lt;&amp;lt; 24) | ((T &amp;amp; 0xFF00) &amp;lt;&amp;lt; 8) | ((T &amp;gt;&amp;gt; 8) &amp;amp; 0xFF00) | ((T &amp;gt;&amp;gt; 24) &amp;amp; 0xFF)));&lt;br /&gt;
&lt;br /&gt;
        S = A + llList2Integer(MD5_k1, round) + T + (D ^ (B &amp;amp; (C ^ D)));&lt;br /&gt;
        T = llList2Integer(MD5_r1, round &amp;amp; 3);&lt;br /&gt;
        A = D;&lt;br /&gt;
        D = C;&lt;br /&gt;
        C = B;&lt;br /&gt;
        B += (S &amp;lt;&amp;lt; T) | ((S &amp;gt;&amp;gt; (32 - T)) &amp;amp; ~(0xFFFFFFFF &amp;lt;&amp;lt; T));&lt;br /&gt;
    }&lt;br /&gt;
    while(16 &amp;gt; (round = -~round));&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        S = A + llList2Integer(MD5_k2, round &amp;amp; 15) + (C ^ (D &amp;amp; (B ^ C))) + llList2Integer(x, (-~(5 * round)) &amp;amp; 15);&lt;br /&gt;
        T = llList2Integer(MD5_r2, round &amp;amp; 3);&lt;br /&gt;
        A = D;&lt;br /&gt;
        D = C;&lt;br /&gt;
        C = B;&lt;br /&gt;
        B += (S &amp;lt;&amp;lt; T) | ((S &amp;gt;&amp;gt; (32 - T)) &amp;amp; ~(0xFFFFFFFF &amp;lt;&amp;lt; T));&lt;br /&gt;
    }&lt;br /&gt;
    while(32 &amp;gt; (round = -~round));&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        S = A + llList2Integer(MD5_k3, round &amp;amp; 15) + (B ^ C ^ D) + llList2Integer(x, (3 * round + 5) &amp;amp; 15);&lt;br /&gt;
        T = llList2Integer(MD5_r3, round &amp;amp; 3);&lt;br /&gt;
        A = D;&lt;br /&gt;
        D = C;&lt;br /&gt;
        C = B;&lt;br /&gt;
        B += (S &amp;lt;&amp;lt; T) | ((S &amp;gt;&amp;gt; (32 - T)) &amp;amp; ~(0xFFFFFFFF &amp;lt;&amp;lt; T));&lt;br /&gt;
    }&lt;br /&gt;
    while(48 &amp;gt; (round = -~round));&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        S = A + llList2Integer(MD5_k4, round &amp;amp; 15) + (C ^ (B | (~D))) + llList2Integer(x, (7 * round) &amp;amp; 15);&lt;br /&gt;
        T = llList2Integer(MD5_r4, round &amp;amp; 3);&lt;br /&gt;
        A = D;&lt;br /&gt;
        D = C;&lt;br /&gt;
        C = B;&lt;br /&gt;
        B += (S &amp;lt;&amp;lt; T) | ((S &amp;gt;&amp;gt; (32 - T)) &amp;amp; ~(0xFFFFFFFF &amp;lt;&amp;lt; T));&lt;br /&gt;
    }&lt;br /&gt;
    while(64 &amp;gt; (round = -~round));&lt;br /&gt;
//        llOwnerSay(llList2CSV(x));&lt;br /&gt;
&lt;br /&gt;
    return [H1+A, H2+B, H3+C, H4+D];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
string Base64MD5forHMAC(string b64, integer bit_length, integer extra_bit_length, integer H1, integer H2, integer H3, integer H4)&lt;br /&gt;
{&lt;br /&gt;
    //OR on the extra bit.&lt;br /&gt;
    integer b = (~-(((bit_length + 552) &amp;amp; -512) &amp;gt;&amp;gt; 5));&lt;br /&gt;
    integer T = llBase64ToInteger(RemovePadding(llGetSubString(b64, -4, -1)) + &amp;quot;AAAA&amp;quot;);&lt;br /&gt;
    string buf = &amp;quot;AAA&amp;quot;;&lt;br /&gt;
    integer i = -5;&lt;br /&gt;
    do buf += buf; while((i = -~i));&lt;br /&gt;
    if(bit_length)&lt;br /&gt;
    {&lt;br /&gt;
        i = 0x800000;&lt;br /&gt;
        if(!(bit_length % 24))&lt;br /&gt;
            i = 0x80;&lt;br /&gt;
        else if((bit_length % 24) == 16)&lt;br /&gt;
            i = 0x8000;&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
        T = 0x80000000;//T is corrupt because of https://jira.secondlife.com/browse/SVC-104&lt;br /&gt;
//    llOwnerSay(llList2CSV([i,j]));&lt;br /&gt;
    bit_length += extra_bit_length;&lt;br /&gt;
    b64 = llGetSubString( llDeleteSubString(b64, -4, -1) + &lt;br /&gt;
                          llGetSubString(llIntegerToBase64(T | i), 0, 5) + &lt;br /&gt;
                          buf, 0, ((b &amp;lt;&amp;lt; 4) / 3) - 7) + &lt;br /&gt;
          llGetSubString(llIntegerToBase64((((bit_length &amp;amp; 0xFF) &amp;lt;&amp;lt; 20) | ((bit_length &amp;amp; 0xFF00) &amp;lt;&amp;lt; 4) | ((bit_length &amp;gt;&amp;gt; 12) &amp;amp; 0xFF0) | ((bit_length &amp;gt;&amp;gt; 28) &amp;amp; 0xF)) &amp;gt;&amp;gt; ((b % 3) &amp;lt;&amp;lt; 1)), 0, 5) + &lt;br /&gt;
            &amp;quot;AAAAAAAA&amp;quot;;&lt;br /&gt;
    i = 0;&lt;br /&gt;
    list x;&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        x = Base64MD5Compress(b64, H1, H2, H3, H4, i);&lt;br /&gt;
        H1 = llList2Integer(x, 0);&lt;br /&gt;
        H2 = llList2Integer(x, 1);&lt;br /&gt;
        H3 = llList2Integer(x, 2);&lt;br /&gt;
        H4 = llList2Integer(x, 3);&lt;br /&gt;
    }while(b &amp;gt; (i += 16));&lt;br /&gt;
    i = -4;&lt;br /&gt;
    buf = &amp;quot;&amp;quot;;&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        T = llList2Integer(x,~i);&lt;br /&gt;
        bit_length = 32;&lt;br /&gt;
        do&lt;br /&gt;
            buf = llGetSubString(hexc, b = ((T &amp;gt;&amp;gt; (bit_length - 4)) &amp;amp; 0xF), b) + llGetSubString(hexc, b = ((T &amp;gt;&amp;gt; (bit_length - 8)) &amp;amp; 0xF), b) + buf;&lt;br /&gt;
        while ((bit_length -= 8));&lt;br /&gt;
    }while ((i = -~i));&lt;br /&gt;
    return buf;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// The Real Thing&lt;br /&gt;
string Base64_HMAC_MD5(string B64Key, string B64Data)&lt;br /&gt;
{&lt;br /&gt;
    integer bit_length = llSubStringIndex(B64Key, &amp;quot;=&amp;quot;);&lt;br /&gt;
    if (!~bit_length)&lt;br /&gt;
    {&lt;br /&gt;
        bit_length = llStringLength(B64Key);&lt;br /&gt;
    }&lt;br /&gt;
    if (bit_length &amp;gt; 86)&lt;br /&gt;
    {&lt;br /&gt;
        B64Key = HexToBase64Unpadded(Base64MD5forHMAC(B64Key, (bit_length*6)&amp;amp;-8, 0, 1732584193, -271733879, -1732584194, 271733878));&lt;br /&gt;
        bit_length = 22;&lt;br /&gt;
    }&lt;br /&gt;
    B64Key = llGetSubString(B64Key, 0, bit_length-1);&lt;br /&gt;
    string buf = &amp;quot;AAA&amp;quot;;&lt;br /&gt;
    integer i = -5;&lt;br /&gt;
    do buf += buf; while((i = -~i));&lt;br /&gt;
    B64Key = llXorBase64StringsCorrect(llGetSubString(B64Key + buf, 0, 85) + &amp;quot;==&amp;quot;, &amp;quot;NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2Ng==&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    list x = Base64MD5Compress(B64Key, 1732584193, -271733879, -1732584194, 271733878, 0);&lt;br /&gt;
    bit_length = (6 * !(B64Data==&amp;quot;&amp;quot;) * (llStringLength(B64Data)-4+llStringLength(RemovePadding(llGetSubString(B64Data,-4,-1))))) &amp;amp; -8;&lt;br /&gt;
    B64Data = HexToBase64Unpadded(Base64MD5forHMAC(B64Data, bit_length, 512, llList2Integer(x, 0), llList2Integer(x, 1), llList2Integer(x, 2), llList2Integer(x, 3))) + &amp;quot;==&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    // Xor with Base64(chr(0x36 xor 0x5C) * 64)&lt;br /&gt;
    B64Key = llXorBase64StringsCorrect(B64Key, &amp;quot;ampqampqampqampqampqampqampqampqampqampqampqampqampqampqampqampqampqampqampqampqampqag==&amp;quot;);&lt;br /&gt;
    x = Base64MD5Compress(B64Key, 1732584193, -271733879, -1732584194, 271733878, 0);&lt;br /&gt;
    bit_length = 128;&lt;br /&gt;
    return Base64MD5forHMAC(B64Data, bit_length, 512, llList2Integer(x, 0), llList2Integer(x, 1), llList2Integer(x, 2), llList2Integer(x, 3));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
test_vector_MD5(string B64Key, string B64Data, string HexHash)&lt;br /&gt;
{&lt;br /&gt;
    llResetTime();&lt;br /&gt;
    string hmac = Base64_HMAC_MD5(B64Key, B64Data);&lt;br /&gt;
    if (hmac != HexHash)&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;HMAC-MD5 test failed.\nComputed: &amp;quot; + hmac + &amp;quot;\nExpected : &amp;quot; + HexHash);&lt;br /&gt;
    }&lt;br /&gt;
    else&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;HMAC-MD5 test passed in &amp;quot; + (string)llGetTime() + &amp;quot; seconds.&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        // RFC 2202 test vectors:&lt;br /&gt;
        test_vector_MD5(HexToBase64Unpadded(&amp;quot;0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b&amp;quot;) + &amp;quot;==&amp;quot;,&lt;br /&gt;
                        llStringToBase64(&amp;quot;Hi There&amp;quot;),&lt;br /&gt;
                        &amp;quot;9294727a3638bb1c13f48ef8158bfc9d&amp;quot;);&lt;br /&gt;
        test_vector_MD5(llStringToBase64(&amp;quot;Jefe&amp;quot;),&lt;br /&gt;
                        llStringToBase64(&amp;quot;what do ya want for nothing?&amp;quot;),&lt;br /&gt;
                        &amp;quot;750c783e6ab0b503eaa86e310a5db738&amp;quot;);&lt;br /&gt;
        test_vector_MD5(&amp;quot;qqqqqqqqqqqqqqqqqqqqqg==&amp;quot;,&lt;br /&gt;
                        &amp;quot;3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d0=&amp;quot;,&lt;br /&gt;
                        &amp;quot;56be34521d144c88dbb8c733f0e8b3f6&amp;quot;);&lt;br /&gt;
        test_vector_MD5(HexToBase64Unpadded(&amp;quot;0102030405060708090a0b0c0d0e0f10111213141516171819&amp;quot;)+&amp;quot;==&amp;quot;,&lt;br /&gt;
                        HexToBase64Unpadded(&amp;quot;cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd&amp;quot;)+&amp;quot;=&amp;quot;,&lt;br /&gt;
                        &amp;quot;697eaf0aca3a3aea3a75164746ffaa79&amp;quot;);&lt;br /&gt;
        test_vector_MD5(HexToBase64Unpadded(&amp;quot;0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c&amp;quot;) + &amp;quot;==&amp;quot;,&lt;br /&gt;
                        llStringToBase64(&amp;quot;Test With Truncation&amp;quot;),&lt;br /&gt;
                        &amp;quot;56461ef2342edc00f9bab995690efd4c&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        string buf = &amp;quot;aaaaa&amp;quot;;&lt;br /&gt;
        buf += buf;&lt;br /&gt;
        buf += buf;&lt;br /&gt;
        buf += buf;&lt;br /&gt;
        buf += buf;&lt;br /&gt;
        buf += buf;&lt;br /&gt;
        test_vector_MD5(HexToBase64Unpadded(buf) + &amp;quot;=&amp;quot;,&lt;br /&gt;
                        llStringToBase64(&amp;quot;Test Using Larger Than Block-Size Key - Hash Key First&amp;quot;),&lt;br /&gt;
                        &amp;quot;6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd&amp;quot;);&lt;br /&gt;
        test_vector_MD5(HexToBase64Unpadded(buf) + &amp;quot;=&amp;quot;,&lt;br /&gt;
                        llStringToBase64(&amp;quot;Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data&amp;quot;),&lt;br /&gt;
                        &amp;quot;6f630fad67cda0ee1fb1f562db3aa53e&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        // Test vectors added by the author for zero-terminated data strings at different padding positions&lt;br /&gt;
        // (generated with an independent program written in PHP):&lt;br /&gt;
        test_vector_MD5(&amp;quot;blah&amp;quot;, &amp;quot;&amp;quot;,         &amp;quot;c10685c0953708077f6f4c7c5511ae53&amp;quot;); // &amp;quot;&amp;quot;&lt;br /&gt;
        test_vector_MD5(&amp;quot;blah&amp;quot;, &amp;quot;AA==&amp;quot;,     &amp;quot;a761432a72606fd467aee08dd354d055&amp;quot;); // &amp;quot;\0&amp;quot;&lt;br /&gt;
        test_vector_MD5(&amp;quot;blah&amp;quot;, &amp;quot;AAA=&amp;quot;,     &amp;quot;7ec1859fa4f3dc93557de5b6e0e6b579&amp;quot;); // &amp;quot;\0\0&amp;quot;&lt;br /&gt;
        test_vector_MD5(&amp;quot;blah&amp;quot;, &amp;quot;AAAA&amp;quot;,     &amp;quot;daa25eabf94b653324a7d014bacf93ce&amp;quot;); // &amp;quot;\0\0\0&amp;quot;&lt;br /&gt;
        test_vector_MD5(&amp;quot;blah&amp;quot;, &amp;quot;MQA=&amp;quot;,     &amp;quot;ed3a85846a50c499d0eee5789eb32f4d&amp;quot;); // &amp;quot;1\0&amp;quot;&lt;br /&gt;
        test_vector_MD5(&amp;quot;blah&amp;quot;, &amp;quot;MQAA&amp;quot;,     &amp;quot;df9ebb2a9194f1ccc005016cd7b8d2c2&amp;quot;); // &amp;quot;1\0\0&amp;quot;&lt;br /&gt;
        test_vector_MD5(&amp;quot;blah&amp;quot;, &amp;quot;MQAAAA==&amp;quot;, &amp;quot;84106dafe40539b5b7d680cc05ee5836&amp;quot;); // &amp;quot;1\0\0\0&amp;quot;&lt;br /&gt;
        test_vector_MD5(&amp;quot;blah&amp;quot;, &amp;quot;MTIA&amp;quot;,     &amp;quot;a2aaec505f58dc3267f39b7c1ad130ba&amp;quot;); // &amp;quot;12\0&amp;quot;&lt;br /&gt;
        test_vector_MD5(&amp;quot;blah&amp;quot;, &amp;quot;MTIAAA==&amp;quot;, &amp;quot;24b9ea69f29389136386c06632a0e4c2&amp;quot;); // &amp;quot;12\0\0&amp;quot;&lt;br /&gt;
        test_vector_MD5(&amp;quot;blah&amp;quot;, &amp;quot;MTIAAAA=&amp;quot;, &amp;quot;dbf936625759ada5eacc7f88f66ff20e&amp;quot;); // &amp;quot;12\0\0\0&amp;quot;&lt;br /&gt;
        test_vector_MD5(&amp;quot;blah&amp;quot;, &amp;quot;MTIzAA==&amp;quot;, &amp;quot;8f2b761ddcf87a60593bde245691b409&amp;quot;); // &amp;quot;123\0&amp;quot;&lt;br /&gt;
        test_vector_MD5(&amp;quot;blah&amp;quot;, &amp;quot;MTIzAAA=&amp;quot;, &amp;quot;9c196ba2c2dc1fa610800fd026e3f405&amp;quot;); // &amp;quot;123\0\0&amp;quot;&lt;br /&gt;
        test_vector_MD5(&amp;quot;blah&amp;quot;, &amp;quot;MTIzAAAA&amp;quot;, &amp;quot;a0331f1846fa6937347e62ec7414ee43&amp;quot;); // &amp;quot;123\0\0\0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        // Test vector added by the author&lt;br /&gt;
        test_vector_MD5(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;74e6f7298a9c2d168935f58c001bad88&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        // Test vectors added by the author to check for corner cases with the padding.&lt;br /&gt;
        // Buffer exactly 54 bytes; needs 1+1 padding bytes, this should not be a problem.&lt;br /&gt;
        test_vector_MD5(&amp;quot;blah&amp;quot;,&lt;br /&gt;
                        &amp;quot;012345670123456701234567012345670123456701234567012345670123&amp;quot;,&lt;br /&gt;
                        &amp;quot;ed5accadc5138ea952d2cb519406f928&amp;quot;);&lt;br /&gt;
        // Buffer exactly 55 bytes; needs 1+0 padding bytes, this might be a problem if adding 0 bytes is a problem.&lt;br /&gt;
        test_vector_MD5(&amp;quot;blah&amp;quot;,&lt;br /&gt;
                        &amp;quot;0123456701234567012345670123456701234567012345670123456701234A==&amp;quot;,&lt;br /&gt;
                        &amp;quot;123d6892faec7f8d30844711b32be334&amp;quot;);&lt;br /&gt;
        // Buffer exactly 56 bytes; needs 1+7+56 padding bytes. Problematic only in case the detection of the corner case is flawed.&lt;br /&gt;
        test_vector_MD5(&amp;quot;blah&amp;quot;,&lt;br /&gt;
                        &amp;quot;01234567012345670123456701234567012345670123456701234567012345A=&amp;quot;,&lt;br /&gt;
                        &amp;quot;1651d80e8892463daa9aca2d0a9a2f76&amp;quot;);&lt;br /&gt;
        // Buffer exactly 63 bytes; needs 1+56 padding bytes. The first byte must be appended to the end of the buffer; the rest in the next buffer.&lt;br /&gt;
        test_vector_MD5(&amp;quot;blah&amp;quot;,&lt;br /&gt;
                        &amp;quot;012345670123456701234567012345670123456701234567012345670123456701234567012345670123&amp;quot;,&lt;br /&gt;
                        &amp;quot;3eb5654edd27e2441e7a521827ff6a77&amp;quot;);&lt;br /&gt;
        // Buffer exactly 64 bytes; needs 1+55 padding bytes added to the next buffer. Should not be a problem.&lt;br /&gt;
        test_vector_MD5(&amp;quot;blah&amp;quot;,&lt;br /&gt;
                        &amp;quot;0123456701234567012345670123456701234567012345670123456701234567012345670123456701234A==&amp;quot;,&lt;br /&gt;
                        &amp;quot;25fd54c13d95468e2f525163d7b6d63d&amp;quot;);&lt;br /&gt;
        llOwnerSay(&amp;quot;End of tests.&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Pedro_Oval/Mono_code_memory_usage/CIL&amp;diff=1194723</id>
		<title>User:Pedro Oval/Mono code memory usage/CIL</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Pedro_Oval/Mono_code_memory_usage/CIL&amp;diff=1194723"/>
		<updated>2015-01-24T04:27:05Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: oops, LSL2, not LSL&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here&#039;s the CIL code generated by the script below, which gives some insight of what&#039;s happening under the hood.&lt;br /&gt;
&lt;br /&gt;
Compilation was done using the viewer&#039;s built-in compiler as suggested by [[User:Becky Pippen/LSL Performance]]. Assembly was done using &amp;lt;code&amp;gt;ilasm&amp;lt;/code&amp;gt; from the Mono suite.&lt;br /&gt;
&lt;br /&gt;
Script that gets compiled:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
integer i;&lt;br /&gt;
u(){}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        integer x;&lt;br /&gt;
        integer y = 0;&lt;br /&gt;
        integer z;&lt;br /&gt;
        float f;&lt;br /&gt;
        float g;&lt;br /&gt;
        vector v;&lt;br /&gt;
        list a;&lt;br /&gt;
&lt;br /&gt;
        ;;;;;;;;;{{{{{{{{}}}}}}}}&lt;br /&gt;
        return;&lt;br /&gt;
        x;&lt;br /&gt;
        (x);&lt;br /&gt;
        (integer)x;&lt;br /&gt;
        (float)x;&lt;br /&gt;
        f;&lt;br /&gt;
        (float)f;&lt;br /&gt;
        (integer)f;&lt;br /&gt;
        v;&lt;br /&gt;
        v.z;&lt;br /&gt;
        -x;&lt;br /&gt;
        ~x;&lt;br /&gt;
        !x;&lt;br /&gt;
        --x;&lt;br /&gt;
        ++x;&lt;br /&gt;
        x--;&lt;br /&gt;
        x++;&lt;br /&gt;
        x=y;&lt;br /&gt;
        x==y;&lt;br /&gt;
        x=y=z;&lt;br /&gt;
        f=x;&lt;br /&gt;
        f=(float)x;&lt;br /&gt;
        x!=y;&lt;br /&gt;
        x+y;&lt;br /&gt;
        x-y;&lt;br /&gt;
        x+-y;&lt;br /&gt;
        x*y;&lt;br /&gt;
        x/y;&lt;br /&gt;
        x%y;&lt;br /&gt;
        x&amp;amp;y;&lt;br /&gt;
        x&amp;amp;&amp;amp;y;&lt;br /&gt;
        x|y;&lt;br /&gt;
        x||y;&lt;br /&gt;
        x^y;&lt;br /&gt;
        x&amp;lt;&amp;lt;y;&lt;br /&gt;
        x&amp;gt;&amp;gt;y;&lt;br /&gt;
        x&amp;lt;y;&lt;br /&gt;
        x&amp;gt;y;&lt;br /&gt;
        x&amp;lt;=y;&lt;br /&gt;
        x&amp;gt;=y;&lt;br /&gt;
        x+=y;&lt;br /&gt;
        x-=y;&lt;br /&gt;
        x+=-y;&lt;br /&gt;
        x*=y;&lt;br /&gt;
        x/=y;&lt;br /&gt;
        x%=y;&lt;br /&gt;
        if (x) ;&lt;br /&gt;
        if (x) ; else ;&lt;br /&gt;
        0;&lt;br /&gt;
        x^x;&lt;br /&gt;
        1;&lt;br /&gt;
        -1;&lt;br /&gt;
        0xffffffff;&lt;br /&gt;
        ALL_SIDES;&lt;br /&gt;
        x|~x;&lt;br /&gt;
        x+1;&lt;br /&gt;
        -~x;&lt;br /&gt;
        x-1;&lt;br /&gt;
        x+-1;&lt;br /&gt;
        ~-x;&lt;br /&gt;
        x*y+y-1;&lt;br /&gt;
        (x+1)*y-1;&lt;br /&gt;
        ~(~x*y)&lt;br /&gt;
        while (x) ;&lt;br /&gt;
        do ; while (x);&lt;br /&gt;
        for (;x;) ;&lt;br /&gt;
        @label; if (x) jump label;&lt;br /&gt;
        0.0;&lt;br /&gt;
        f=0.0;&lt;br /&gt;
        f=0;&lt;br /&gt;
        &amp;lt;0.0, 0.0, 0.0&amp;gt;;&lt;br /&gt;
        ZERO_VECTOR;&lt;br /&gt;
        &amp;lt;0, 0, 0&amp;gt;;&lt;br /&gt;
        &amp;lt;-1.0, -1.0, 0.0&amp;gt;;&lt;br /&gt;
        TOUCH_INVALID_TEXCOORD;&lt;br /&gt;
        &amp;lt;-1, -1, 0&amp;gt;;&lt;br /&gt;
        &amp;lt;0xffffffff, 0xffffffff, 0&amp;gt;;&lt;br /&gt;
        v+v;&lt;br /&gt;
        v-v;&lt;br /&gt;
        v*v;&lt;br /&gt;
        v%v;&lt;br /&gt;
        [];&lt;br /&gt;
        a=[];&lt;br /&gt;
        a+[x];&lt;br /&gt;
        a+x;&lt;br /&gt;
        [x]+a;&lt;br /&gt;
        x+a;&lt;br /&gt;
        [x];&lt;br /&gt;
        []+x;&lt;br /&gt;
        (list)x;&lt;br /&gt;
        [x,y];&lt;br /&gt;
        []+x+y;&lt;br /&gt;
        (string)a;&lt;br /&gt;
        i;&lt;br /&gt;
        u();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compiled and annotated result:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
          .assembly extern mscorlib {.ver 1:0:5000:0}&lt;br /&gt;
          .assembly extern LslLibrary {.ver 0:1:0:0}&lt;br /&gt;
          .assembly extern LslUserScript {.ver 0:1:0:0}&lt;br /&gt;
          .assembly extern ScriptTypes {.ver 0:1:0:0}&lt;br /&gt;
          .assembly &#039;LSL_y&#039; {.ver 0:0:0:0}&lt;br /&gt;
          .class public auto ansi serializable beforefieldinit LSL_y extends [LslUserScript]LindenLab.SecondLife.LslUserScript&lt;br /&gt;
          {&lt;br /&gt;
              .field public int32 &#039;i&#039;&lt;br /&gt;
              .method public hidebysig  specialname  rtspecialname instance default void .ctor ()  cil managed&lt;br /&gt;
              {&lt;br /&gt;
                  .maxstack 500&lt;br /&gt;
&lt;br /&gt;
                  // Globals initialization&lt;br /&gt;
&lt;br /&gt;
                  // integer i;&lt;br /&gt;
02                ldarg.0&lt;br /&gt;
16                ldc.i4.0&lt;br /&gt;
7D 01 00 00 04    stfld int32 LSL_y::&#039;i&#039;&lt;br /&gt;
&lt;br /&gt;
02                ldarg.0&lt;br /&gt;
28 01 00 00 0A    call instance void [LslUserScript]LindenLab.SecondLife.LslUserScript::.ctor()&lt;br /&gt;
2A                ret&lt;br /&gt;
              }&lt;br /&gt;
              .method public hidebysig instance default void &#039;gu&#039;() cil managed&lt;br /&gt;
              {&lt;br /&gt;
                  .maxstack 500&lt;br /&gt;
2A                ret&lt;br /&gt;
              }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              .method public hidebysig instance default void edefaultstate_entry() cil managed&lt;br /&gt;
              {&lt;br /&gt;
                  .maxstack 500&lt;br /&gt;
                  .locals init (int32, int32, int32, float32, float32, class [ScriptTypes]LindenLab.SecondLife.Vector, class [mscorlib]System.Collections.ArrayList)&lt;br /&gt;
                  // integer x;&lt;br /&gt;
16                ldc.i4.0&lt;br /&gt;
13 00             stloc.s 0&lt;br /&gt;
&lt;br /&gt;
                  // integer y = 0;&lt;br /&gt;
20 00 00 00 00    ldc.i4 0&lt;br /&gt;
13 01             stloc.s 1&lt;br /&gt;
&lt;br /&gt;
                  // integer z;&lt;br /&gt;
16                ldc.i4.0&lt;br /&gt;
13 02             stloc.s 2&lt;br /&gt;
&lt;br /&gt;
                  // float f;&lt;br /&gt;
23 00 00 00 00    ldc.r8 0&lt;br /&gt;
00 00 00 00&lt;br /&gt;
13 03             stloc.s 3&lt;br /&gt;
&lt;br /&gt;
                  // float g;&lt;br /&gt;
23 00 00 00 00    ldc.r8 0&lt;br /&gt;
00 00 00 00&lt;br /&gt;
13 04             stloc.s 4&lt;br /&gt;
&lt;br /&gt;
                  // vector v;&lt;br /&gt;
23 00 00 00 00    ldc.r8 0&lt;br /&gt;
00 00 00 00&lt;br /&gt;
23 00 00 00 00    ldc.r8 0&lt;br /&gt;
00 00 00 00&lt;br /&gt;
23 00 00 00 00    ldc.r8 0&lt;br /&gt;
00 00 00 00&lt;br /&gt;
28 02 00 00 0A    call class [ScriptTypes]LindenLab.SecondLife.Vector class [LslUserScript]LindenLab.SecondLife.LslUserScript::&#039;CreateVector&#039;(float32, float32, float32)&lt;br /&gt;
13 05             stloc.s 5&lt;br /&gt;
&lt;br /&gt;
                  // list a;&lt;br /&gt;
28 03 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::CreateList()&lt;br /&gt;
13 06             stloc.s 6&lt;br /&gt;
&lt;br /&gt;
                  // ;;; {{{ }}} generate no code&lt;br /&gt;
&lt;br /&gt;
                  // return;&lt;br /&gt;
2A                ret&lt;br /&gt;
&lt;br /&gt;
                  // x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // (x);&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // (integer)x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // (float)x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
6C                conv.r8&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // f;&lt;br /&gt;
11 03             ldloc.s 3&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // (float)f;&lt;br /&gt;
11 03             ldloc.s 3&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // (integer)f;&lt;br /&gt;
11 03             ldloc.s 3&lt;br /&gt;
28 04 00 00 0A    call int32 [LslLibrary]LindenLab.SecondLife.LslRunTime::ToInteger(float32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // v;&lt;br /&gt;
11 05             ldloc.s 5&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // v.z;&lt;br /&gt;
12 05             ldloca.s 5&lt;br /&gt;
78 05 00 00 0A    ldfld float32 class [ScriptTypes]LindenLab.SecondLife.Vector::z&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // -x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
65                neg&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // ~x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
66                not&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // !x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
16                ldc.i4.0&lt;br /&gt;
FE 01             ceq&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // --x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
17                ldc.i4.1&lt;br /&gt;
59                sub&lt;br /&gt;
25                dup&lt;br /&gt;
13 00             stloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // ++x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
17                ldc.i4.1&lt;br /&gt;
58                add&lt;br /&gt;
25                dup&lt;br /&gt;
13 00             stloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x--;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
17                ldc.i4.1&lt;br /&gt;
59                sub&lt;br /&gt;
25                dup&lt;br /&gt;
13 00             stloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x++;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
17                ldc.i4.1&lt;br /&gt;
58                add&lt;br /&gt;
25                dup&lt;br /&gt;
13 00             stloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x = y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
25                dup&lt;br /&gt;
13 00             stloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x == y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
FE 01             ceq&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x = y = z;&lt;br /&gt;
11 02             ldloc.s 2&lt;br /&gt;
25                dup&lt;br /&gt;
13 01             stloc.s 1&lt;br /&gt;
25                dup&lt;br /&gt;
13 00             stloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // f = x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
6C                conv.r8&lt;br /&gt;
25                dup&lt;br /&gt;
13 03             stloc.s 3&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // f = (float)x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
6C                conv.r8&lt;br /&gt;
25                dup&lt;br /&gt;
13 03             stloc.s 3&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x != y; implemented as: !(x==y)&lt;br /&gt;
11 01             ldloc.s 1  // this part is x == y&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
FE 01             ceq&lt;br /&gt;
16                ldc.i4.0   // this part is &#039;not&#039;&lt;br /&gt;
FE 01             ceq&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x + y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
58                add&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x - y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
28 06 00 00 0A    call int32 [LslUserScript]LindenLab.SecondLife.LslUserScript::Subtract(int32, int32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x + -y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
65                neg&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
58                add&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x * y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
5A                mul&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x / y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
28 07 00 00 0A    call int32 [LslUserScript]LindenLab.SecondLife.LslUserScript::Divide(int32, int32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x % y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
28 08 00 00 0A    call int32 [LslUserScript]LindenLab.SecondLife.LslUserScript::Modulo(int32, int32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x &amp;amp; y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
5F                and&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x &amp;amp;&amp;amp; y; implemented as: !(!x | !y)&lt;br /&gt;
11 01             ldloc.s 1    // !x&lt;br /&gt;
16                ldc.i4.0&lt;br /&gt;
FE 01             ceq&lt;br /&gt;
11 00             ldloc.s 0    // !y&lt;br /&gt;
16                ldc.i4.0&lt;br /&gt;
FE 01             ceq&lt;br /&gt;
60                or           // !x | !y&lt;br /&gt;
16                ldc.i4.0     // !(!x | !y)&lt;br /&gt;
FE 01             ceq&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x | y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
60                or&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x || y; implemented as: !!(x | y)&lt;br /&gt;
11 01             ldloc.s 1    // x | y&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
60                or&lt;br /&gt;
16                ldc.i4.0     // !(x | y)&lt;br /&gt;
FE 01             ceq&lt;br /&gt;
16                ldc.i4.0     // !!(x | y)&lt;br /&gt;
FE 01             ceq&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x ^ y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
61                xor&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x &amp;lt;&amp;lt; y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
28 09 00 00 0A    call int32 [LslUserScript]LindenLab.SecondLife.LslUserScript::ShiftLeft(int32, int32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x &amp;gt;&amp;gt; y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
28 0A 00 00 0A    call int32 [LslUserScript]LindenLab.SecondLife.LslUserScript::ShiftRight(int32, int32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x &amp;lt; y; implemented as: y &amp;gt; x&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
FE 02             cgt&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x &amp;gt; y; implemented as: y &amp;lt; x;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
FE 04             clt&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x &amp;lt;= y; implemented as: !(y &amp;lt; x)&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
FE 04             clt&lt;br /&gt;
16                ldc.i4.0&lt;br /&gt;
FE 01             ceq&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x &amp;gt;= y; implemented as: !(y &amp;gt; x)&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
FE 02             cgt&lt;br /&gt;
16                ldc.i4.0&lt;br /&gt;
FE 01             ceq&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x += y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
58                add&lt;br /&gt;
25                dup&lt;br /&gt;
13 00             stloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x -= y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
28 06 00 00 0A    call int32 [LslUserScript]LindenLab.SecondLife.LslUserScript::Subtract(int32, int32)&lt;br /&gt;
25                dup&lt;br /&gt;
13 00             stloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x += -y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
65                neg&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
58                add&lt;br /&gt;
25                dup&lt;br /&gt;
13 00             stloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x *= y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
5A                mul&lt;br /&gt;
25                dup&lt;br /&gt;
13 00             stloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x /= y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
28 07 00 00 0A    call int32 [LslUserScript]LindenLab.SecondLife.LslUserScript::Divide(int32, int32)&lt;br /&gt;
25                dup&lt;br /&gt;
13 00             stloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x %= y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
28 08 00 00 0A    call int32 [LslUserScript]LindenLab.SecondLife.LslUserScript::Modulo(int32, int32)&lt;br /&gt;
25                dup&lt;br /&gt;
13 00             stloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // if (x) ;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
39 00 00 00 00    brfalse LabelTempJump0&lt;br /&gt;
                  // THEN branch code goes here&lt;br /&gt;
              LabelTempJump0:&lt;br /&gt;
&lt;br /&gt;
                  // if (x) ; else ;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
39 05 00 00 00    brfalse LabelTempJump1&lt;br /&gt;
                  // THEN branch code would go here&lt;br /&gt;
38 00 00 00 00    br LabelTempJump2&lt;br /&gt;
                  // ELSE branch code would go here&lt;br /&gt;
              LabelTempJump1:&lt;br /&gt;
              LabelTempJump2:&lt;br /&gt;
&lt;br /&gt;
                  // 0;&lt;br /&gt;
20 00 00 00 00    ldc.i4 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x ^ x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
61                xor&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // 1;&lt;br /&gt;
20 01 00 00 00    ldc.i4 1&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // -1; note the negative sign takes code memory&lt;br /&gt;
20 01 00 00 00    ldc.i4 1&lt;br /&gt;
65                neg&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // 0xffffffff; note it equals -1 without the sign taking memory&lt;br /&gt;
20 FF FF FF FF    ldc.i4 -1&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // ALL_SIDES; ditto&lt;br /&gt;
20 FF FF FF FF    ldc.i4 -1&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x | ~x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
66                not&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
60                or&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x + 1;&lt;br /&gt;
20 01 00 00 00    ldc.i4 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
58                add&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // -~x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
66                not&lt;br /&gt;
65                neg&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x - 1;&lt;br /&gt;
20 01 00 00 00    ldc.i4 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
28 06 00 00 0A    call int32 [LslUserScript]LindenLab.SecondLife.LslUserScript::Subtract(int32, int32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x + -1;&lt;br /&gt;
20 01 00 00 00    ldc.i4 1&lt;br /&gt;
65                neg&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
58                add&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // ~-x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
65                neg&lt;br /&gt;
66                not&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x*y + y - 1;&lt;br /&gt;
20 01 00 00 00    ldc.i4 1&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
5A                mul&lt;br /&gt;
58                add&lt;br /&gt;
28 06 00 00 0A    call int32 [LslUserScript]LindenLab.SecondLife.LslUserScript::Subtract(int32, int32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // (x + 1)*y - 1;&lt;br /&gt;
20 01 00 00 00    ldc.i4 1&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
20 01 00 00 00    ldc.i4 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
58                add&lt;br /&gt;
5A                mul&lt;br /&gt;
28 06 00 00 0A    call int32 [LslUserScript]LindenLab.SecondLife.LslUserScript::Subtract(int32, int32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // ~(~x*y);&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
66                not&lt;br /&gt;
5A                mul&lt;br /&gt;
66                not&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // while (x) ;&lt;br /&gt;
              LabelTempJump3:&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
39 05 00 00 00    brfalse LabelTempJump4&lt;br /&gt;
                  // Looped code would go here&lt;br /&gt;
38 F4 FF FF FF    br LabelTempJump3&lt;br /&gt;
              LabelTempJump4:&lt;br /&gt;
&lt;br /&gt;
                  // do ; while (x);&lt;br /&gt;
              LabelTempJump5:&lt;br /&gt;
                  // Looped code would go here&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
3A F9 FF FF FF    brtrue LabelTempJump5&lt;br /&gt;
&lt;br /&gt;
                  // for (; x; ) ;&lt;br /&gt;
              LabelTempJump6:&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
39 05 00 00 00    brfalse LabelTempJump7&lt;br /&gt;
                  // Looped code would go here&lt;br /&gt;
38 F4 FF FF FF    br LabelTempJump6&lt;br /&gt;
              LabelTempJump7:&lt;br /&gt;
&lt;br /&gt;
                  // @label; if (x) jump label;&lt;br /&gt;
              &#039;label&#039;:&lt;br /&gt;
                  // Looped code would go here&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
39 05 00 00 00    brfalse LabelTempJump8&lt;br /&gt;
38 F4 FF FF FF    br &#039;label&#039;&lt;br /&gt;
              LabelTempJump8:&lt;br /&gt;
&lt;br /&gt;
                  // 0.0;&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 00 00)&lt;br /&gt;
00 00 00 00&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // f = 0.0;&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 00 00)&lt;br /&gt;
00 00 00 00&lt;br /&gt;
25                dup&lt;br /&gt;
13 03             stloc.s 3&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // f = 0;&lt;br /&gt;
20 00 00 00 00    ldc.i4 0&lt;br /&gt;
6C                conv.r8&lt;br /&gt;
25                dup&lt;br /&gt;
13 03             stloc.s 3&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // &amp;lt;0.0, 0.0, 0.0&amp;gt;;&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 00 00)&lt;br /&gt;
00 00 00 00&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 00 00)&lt;br /&gt;
00 00 00 00&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 00 00)&lt;br /&gt;
00 00 00 00&lt;br /&gt;
28 02 00 00 0A    call class [ScriptTypes]LindenLab.SecondLife.Vector class [LslUserScript]LindenLab.SecondLife.LslUserScript::&#039;CreateVector&#039;(float32, float32, float32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // ZERO_VECTOR;&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 00 00)&lt;br /&gt;
00 00 00 00&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 00 00)&lt;br /&gt;
00 00 00 00&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 00 00)&lt;br /&gt;
00 00 00 00&lt;br /&gt;
28 02 00 00 0A    call class [ScriptTypes]LindenLab.SecondLife.Vector class [LslUserScript]LindenLab.SecondLife.LslUserScript::&#039;CreateVector&#039;(float32, float32, float32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // &amp;lt;0, 0, 0&amp;gt;;&lt;br /&gt;
20 00 00 00 00    ldc.i4 0&lt;br /&gt;
6C                conv.r8&lt;br /&gt;
20 00 00 00 00    ldc.i4 0&lt;br /&gt;
6C                conv.r8&lt;br /&gt;
20 00 00 00 00    ldc.i4 0&lt;br /&gt;
6C                conv.r8&lt;br /&gt;
28 02 00 00 0A    call class [ScriptTypes]LindenLab.SecondLife.Vector class [LslUserScript]LindenLab.SecondLife.LslUserScript::&#039;CreateVector&#039;(float32, float32, float32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // &amp;lt;-1.0, -1.0, 0.0&amp;gt;;&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 f0 3f)&lt;br /&gt;
00 00 F0 3F&lt;br /&gt;
65                neg&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 f0 3f)&lt;br /&gt;
00 00 F0 3F&lt;br /&gt;
65                neg&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 00 00)&lt;br /&gt;
00 00 00 00&lt;br /&gt;
28 02 00 00 0A    call class [ScriptTypes]LindenLab.SecondLife.Vector class [LslUserScript]LindenLab.SecondLife.LslUserScript::&#039;CreateVector&#039;(float32, float32, float32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // TOUCH_INVALID_TEXCOORD;&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 f0 bf)&lt;br /&gt;
00 00 F0 BF&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 f0 bf)&lt;br /&gt;
00 00 F0 BF&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 00 00)&lt;br /&gt;
00 00 00 00&lt;br /&gt;
28 02 00 00 0A    call class [ScriptTypes]LindenLab.SecondLife.Vector class [LslUserScript]LindenLab.SecondLife.LslUserScript::&#039;CreateVector&#039;(float32, float32, float32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // &amp;lt;-1, -1, 0&amp;gt;;&lt;br /&gt;
20 01 00 00 00    ldc.i4 1&lt;br /&gt;
65                neg&lt;br /&gt;
6C                conv.r8&lt;br /&gt;
20 01 00 00 00    ldc.i4 1&lt;br /&gt;
65                neg&lt;br /&gt;
6C                conv.r8&lt;br /&gt;
20 00 00 00 00    ldc.i4 0&lt;br /&gt;
6C                conv.r8&lt;br /&gt;
28 02 00 00 0A    call class [ScriptTypes]LindenLab.SecondLife.Vector class [LslUserScript]LindenLab.SecondLife.LslUserScript::&#039;CreateVector&#039;(float32, float32, float32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // &amp;lt;0xffffffff, 0xffffffff, 0&amp;gt;;&lt;br /&gt;
20 FF FF FF FF    ldc.i4 -1&lt;br /&gt;
6C                conv.r8&lt;br /&gt;
20 FF FF FF FF    ldc.i4 -1&lt;br /&gt;
6C                conv.r8&lt;br /&gt;
20 00 00 00 00    ldc.i4 0&lt;br /&gt;
6C                conv.r8&lt;br /&gt;
28 02 00 00 0A    call class [ScriptTypes]LindenLab.SecondLife.Vector class [LslUserScript]LindenLab.SecondLife.LslUserScript::&#039;CreateVector&#039;(float32, float32, float32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // v + v;&lt;br /&gt;
11 05             ldloc.s 5&lt;br /&gt;
11 05             ldloc.s 5&lt;br /&gt;
28 0B 00 00 0A    call class [ScriptTypes]LindenLab.SecondLife.Vector class [LslUserScript]LindenLab.SecondLife.LslUserScript::&#039;Add&#039;(class [ScriptTypes]LindenLab.SecondLife.Vector, class [ScriptTypes]LindenLab.SecondLife.Vector)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // v - v;&lt;br /&gt;
11 05             ldloc.s 5&lt;br /&gt;
11 05             ldloc.s 5&lt;br /&gt;
28 0C 00 00 0A    call class [ScriptTypes]LindenLab.SecondLife.Vector class [LslUserScript]LindenLab.SecondLife.LslUserScript::&#039;Subtract&#039;(class [ScriptTypes]LindenLab.SecondLife.Vector, class [ScriptTypes]LindenLab.SecondLife.Vector)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // v * v;&lt;br /&gt;
11 05             ldloc.s 5&lt;br /&gt;
11 05             ldloc.s 5&lt;br /&gt;
28 0D 00 00 0A    call float32 class [LslUserScript]LindenLab.SecondLife.LslUserScript::&#039;Multiply&#039;(class [ScriptTypes]LindenLab.SecondLife.Vector, class [ScriptTypes]LindenLab.SecondLife.Vector)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // v % v;&lt;br /&gt;
11 05             ldloc.s 5&lt;br /&gt;
11 05             ldloc.s 5&lt;br /&gt;
28 0E 00 00 0A    call class [ScriptTypes]LindenLab.SecondLife.Vector class [LslUserScript]LindenLab.SecondLife.LslUserScript::&#039;Modulo&#039;(class [ScriptTypes]LindenLab.SecondLife.Vector, class [ScriptTypes]LindenLab.SecondLife.Vector)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // [];&lt;br /&gt;
28 03 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::CreateList()&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // a = [];&lt;br /&gt;
28 03 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::CreateList()&lt;br /&gt;
25                dup&lt;br /&gt;
13 06             stloc.s 6&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // a + [x];&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
8C 01 00 00 1B    box [mscorlib]System.Int32&lt;br /&gt;
28 03 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::CreateList()&lt;br /&gt;
28 0F 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::Prepend(object, class [mscorlib]System.Collections.ArrayList)&lt;br /&gt;
11 06             ldloc.s 6&lt;br /&gt;
28 10 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::Append(class [mscorlib]System.Collections.ArrayList, class [mscorlib]System.Collections.ArrayList)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // a + x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
11 06             ldloc.s 6&lt;br /&gt;
28 11 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::Append(int32, class [mscorlib]System.Collections.ArrayList)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // [x] + a;&lt;br /&gt;
11 06             ldloc.s 6&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
8C 01 00 00 1B    box [mscorlib]System.Int32&lt;br /&gt;
28 03 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::CreateList()&lt;br /&gt;
28 0F 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::Prepend(object, class [mscorlib]System.Collections.ArrayList)&lt;br /&gt;
28 10 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::Append(class [mscorlib]System.Collections.ArrayList, class [mscorlib]System.Collections.ArrayList)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x + a;&lt;br /&gt;
11 06             ldloc.s 6&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
8C 01 00 00 1B    box [mscorlib]System.Int32&lt;br /&gt;
28 12 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::Prepend(class [mscorlib]System.Collections.ArrayList, object)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // [x];&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
8C 01 00 00 1B    box [mscorlib]System.Int32&lt;br /&gt;
28 03 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::CreateList()&lt;br /&gt;
28 0F 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::Prepend(object, class [mscorlib]System.Collections.ArrayList)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // []+x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
28 03 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::CreateList()&lt;br /&gt;
28 11 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::Append(int32, class [mscorlib]System.Collections.ArrayList)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // (list)x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
8C 01 00 00 1B    box [mscorlib]System.Int32&lt;br /&gt;
28 13 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::CreateList(object)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // [x, y];&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
8C 01 00 00 1B    box [mscorlib]System.Int32&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
8C 01 00 00 1B    box [mscorlib]System.Int32&lt;br /&gt;
28 03 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::CreateList()&lt;br /&gt;
28 0F 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::Prepend(object, class [mscorlib]System.Collections.ArrayList)&lt;br /&gt;
28 0F 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::Prepend(object, class [mscorlib]System.Collections.ArrayList)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // []+x+y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
28 03 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::CreateList()&lt;br /&gt;
28 11 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::Append(int32, class [mscorlib]System.Collections.ArrayList)&lt;br /&gt;
28 11 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::Append(int32, class [mscorlib]System.Collections.ArrayList)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // (string)a;&lt;br /&gt;
11 06             ldloc.s 6&lt;br /&gt;
28 14 00 00 0A    call string [LslLibrary]LindenLab.SecondLife.LslRunTime::ListToString(class [mscorlib]System.Collections.ArrayList)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // i;&lt;br /&gt;
02                ldarg.0&lt;br /&gt;
7B 01 00 00 04    ldfld int32 LSL_y::&#039;i&#039;&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // u();&lt;br /&gt;
02                ldarg.0&lt;br /&gt;
28 02 00 00 06    call instance void class LSL_y::&#039;gu&#039;()&lt;br /&gt;
&lt;br /&gt;
                  // end of event&lt;br /&gt;
2A                ret&lt;br /&gt;
              }&lt;br /&gt;
&lt;br /&gt;
          }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Important notes: =====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;ldloc.s 0&amp;lt;/code&amp;gt; (opcode 11, argument 00) is probably contracted to the abbreviation &amp;lt;code&amp;gt;ldloc.0&amp;lt;/code&amp;gt; (opcode 06) at assembly time, resulting in the length of 2 obtained in the [[User:Pedro Oval/Mono code memory usage|memory usage tests]]. Or possibly the server-side compiler added an optimization of this case (!). Either way, the evidence for this is confirmed by the fact that &amp;lt;code&amp;gt;x;&amp;lt;/code&amp;gt; takes 2 bytes if it&#039;s one of the first four local variables (there are 1-byte opcodes for ldloc.0 through ldloc.3), and 3 bytes otherwise. This applies to all appearances of this opcode and the similar &amp;lt;code&amp;gt;stloc.s&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Local variable definitions seem to take a variable and big number of bytes (averaging about 47 bytes for local integers) if there is a function call anywhere in the event in which they are defined. Reason unknown.&lt;br /&gt;
* Backward jumps seem to take many more bytes than what the CIL result above suggests. Forward jumps, however, seem predictable enough.&lt;br /&gt;
* As things are now, having more than 256 local variables in a single function or event causes wraparound, making the 257th be an alias to the 1st, and so on. If they aren&#039;t the same type, the script crashes at runtime with an uncaught exception. That&#039;s a consequence of using &amp;lt;code&amp;gt;ldloc.s&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;stloc.s&amp;lt;/code&amp;gt; without switching to the long version (&amp;lt;code&amp;gt;ldloc&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;stloc&amp;lt;/code&amp;gt;) when the argument is greater than 255.&lt;br /&gt;
&lt;br /&gt;
===== Additional memory usage notes: =====&lt;br /&gt;
* Global variable, function, and function parameter names do take code memory from the script (as part of some symbol table). Fortunately they take 1 byte per character only, as opposed to Mono strings, which take at least 2 bytes per character (they are UTF-16). That extra code is only taken once per variable, regardless of how many times it is used.&lt;br /&gt;
* In addition to the state code and state change command code, the state names themselves take code memory from the script, as follows:&lt;br /&gt;
** The state name by itself takes no code memory, but internally, each event name includes the state name. The internal name for the event is e.g. &amp;lt;code&amp;gt;edefaultstate_entry&amp;lt;/code&amp;gt; (for state &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt;, event &amp;lt;code&amp;gt;state_entry&amp;lt;/code&amp;gt;), &amp;lt;code&amp;gt;eblahtimer&amp;lt;/code&amp;gt; (for state blah, event &amp;lt;code&amp;gt;timer&amp;lt;/code&amp;gt;). These names take 1 byte per character.&lt;br /&gt;
** If a state switch statement appears in the code, the state name takes additionally 2 bytes per character. (But these strings are reused, so multiple state switch statements don&#039;t take additional space for the strings.)&lt;br /&gt;
&lt;br /&gt;
Although not mentioned above, every single-byte string needs an additional terminating zero byte, and every UTF-16 string needs an additional length prefix byte (or more if longer than 127 bytes, i.e. 63 characters if in the ASCII range) plus an additional terminating zero byte.&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=User:Pedro_Oval/Mono_code_memory_usage/CIL&amp;diff=1194722</id>
		<title>User:Pedro Oval/Mono code memory usage/CIL</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=User:Pedro_Oval/Mono_code_memory_usage/CIL&amp;diff=1194722"/>
		<updated>2015-01-24T04:26:03Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: &amp;lt;lsl&amp;gt; to &amp;lt;source&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here&#039;s the CIL code generated by the script below, which gives some insight of what&#039;s happening under the hood.&lt;br /&gt;
&lt;br /&gt;
Compilation was done using the viewer&#039;s built-in compiler as suggested by [[User:Becky Pippen/LSL Performance]]. Assembly was done using &amp;lt;code&amp;gt;ilasm&amp;lt;/code&amp;gt; from the Mono suite.&lt;br /&gt;
&lt;br /&gt;
Script that gets compiled:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl&amp;quot;&amp;gt;&lt;br /&gt;
integer i;&lt;br /&gt;
u(){}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        integer x;&lt;br /&gt;
        integer y = 0;&lt;br /&gt;
        integer z;&lt;br /&gt;
        float f;&lt;br /&gt;
        float g;&lt;br /&gt;
        vector v;&lt;br /&gt;
        list a;&lt;br /&gt;
&lt;br /&gt;
        ;;;;;;;;;{{{{{{{{}}}}}}}}&lt;br /&gt;
        return;&lt;br /&gt;
        x;&lt;br /&gt;
        (x);&lt;br /&gt;
        (integer)x;&lt;br /&gt;
        (float)x;&lt;br /&gt;
        f;&lt;br /&gt;
        (float)f;&lt;br /&gt;
        (integer)f;&lt;br /&gt;
        v;&lt;br /&gt;
        v.z;&lt;br /&gt;
        -x;&lt;br /&gt;
        ~x;&lt;br /&gt;
        !x;&lt;br /&gt;
        --x;&lt;br /&gt;
        ++x;&lt;br /&gt;
        x--;&lt;br /&gt;
        x++;&lt;br /&gt;
        x=y;&lt;br /&gt;
        x==y;&lt;br /&gt;
        x=y=z;&lt;br /&gt;
        f=x;&lt;br /&gt;
        f=(float)x;&lt;br /&gt;
        x!=y;&lt;br /&gt;
        x+y;&lt;br /&gt;
        x-y;&lt;br /&gt;
        x+-y;&lt;br /&gt;
        x*y;&lt;br /&gt;
        x/y;&lt;br /&gt;
        x%y;&lt;br /&gt;
        x&amp;amp;y;&lt;br /&gt;
        x&amp;amp;&amp;amp;y;&lt;br /&gt;
        x|y;&lt;br /&gt;
        x||y;&lt;br /&gt;
        x^y;&lt;br /&gt;
        x&amp;lt;&amp;lt;y;&lt;br /&gt;
        x&amp;gt;&amp;gt;y;&lt;br /&gt;
        x&amp;lt;y;&lt;br /&gt;
        x&amp;gt;y;&lt;br /&gt;
        x&amp;lt;=y;&lt;br /&gt;
        x&amp;gt;=y;&lt;br /&gt;
        x+=y;&lt;br /&gt;
        x-=y;&lt;br /&gt;
        x+=-y;&lt;br /&gt;
        x*=y;&lt;br /&gt;
        x/=y;&lt;br /&gt;
        x%=y;&lt;br /&gt;
        if (x) ;&lt;br /&gt;
        if (x) ; else ;&lt;br /&gt;
        0;&lt;br /&gt;
        x^x;&lt;br /&gt;
        1;&lt;br /&gt;
        -1;&lt;br /&gt;
        0xffffffff;&lt;br /&gt;
        ALL_SIDES;&lt;br /&gt;
        x|~x;&lt;br /&gt;
        x+1;&lt;br /&gt;
        -~x;&lt;br /&gt;
        x-1;&lt;br /&gt;
        x+-1;&lt;br /&gt;
        ~-x;&lt;br /&gt;
        x*y+y-1;&lt;br /&gt;
        (x+1)*y-1;&lt;br /&gt;
        ~(~x*y)&lt;br /&gt;
        while (x) ;&lt;br /&gt;
        do ; while (x);&lt;br /&gt;
        for (;x;) ;&lt;br /&gt;
        @label; if (x) jump label;&lt;br /&gt;
        0.0;&lt;br /&gt;
        f=0.0;&lt;br /&gt;
        f=0;&lt;br /&gt;
        &amp;lt;0.0, 0.0, 0.0&amp;gt;;&lt;br /&gt;
        ZERO_VECTOR;&lt;br /&gt;
        &amp;lt;0, 0, 0&amp;gt;;&lt;br /&gt;
        &amp;lt;-1.0, -1.0, 0.0&amp;gt;;&lt;br /&gt;
        TOUCH_INVALID_TEXCOORD;&lt;br /&gt;
        &amp;lt;-1, -1, 0&amp;gt;;&lt;br /&gt;
        &amp;lt;0xffffffff, 0xffffffff, 0&amp;gt;;&lt;br /&gt;
        v+v;&lt;br /&gt;
        v-v;&lt;br /&gt;
        v*v;&lt;br /&gt;
        v%v;&lt;br /&gt;
        [];&lt;br /&gt;
        a=[];&lt;br /&gt;
        a+[x];&lt;br /&gt;
        a+x;&lt;br /&gt;
        [x]+a;&lt;br /&gt;
        x+a;&lt;br /&gt;
        [x];&lt;br /&gt;
        []+x;&lt;br /&gt;
        (list)x;&lt;br /&gt;
        [x,y];&lt;br /&gt;
        []+x+y;&lt;br /&gt;
        (string)a;&lt;br /&gt;
        i;&lt;br /&gt;
        u();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compiled and annotated result:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
          .assembly extern mscorlib {.ver 1:0:5000:0}&lt;br /&gt;
          .assembly extern LslLibrary {.ver 0:1:0:0}&lt;br /&gt;
          .assembly extern LslUserScript {.ver 0:1:0:0}&lt;br /&gt;
          .assembly extern ScriptTypes {.ver 0:1:0:0}&lt;br /&gt;
          .assembly &#039;LSL_y&#039; {.ver 0:0:0:0}&lt;br /&gt;
          .class public auto ansi serializable beforefieldinit LSL_y extends [LslUserScript]LindenLab.SecondLife.LslUserScript&lt;br /&gt;
          {&lt;br /&gt;
              .field public int32 &#039;i&#039;&lt;br /&gt;
              .method public hidebysig  specialname  rtspecialname instance default void .ctor ()  cil managed&lt;br /&gt;
              {&lt;br /&gt;
                  .maxstack 500&lt;br /&gt;
&lt;br /&gt;
                  // Globals initialization&lt;br /&gt;
&lt;br /&gt;
                  // integer i;&lt;br /&gt;
02                ldarg.0&lt;br /&gt;
16                ldc.i4.0&lt;br /&gt;
7D 01 00 00 04    stfld int32 LSL_y::&#039;i&#039;&lt;br /&gt;
&lt;br /&gt;
02                ldarg.0&lt;br /&gt;
28 01 00 00 0A    call instance void [LslUserScript]LindenLab.SecondLife.LslUserScript::.ctor()&lt;br /&gt;
2A                ret&lt;br /&gt;
              }&lt;br /&gt;
              .method public hidebysig instance default void &#039;gu&#039;() cil managed&lt;br /&gt;
              {&lt;br /&gt;
                  .maxstack 500&lt;br /&gt;
2A                ret&lt;br /&gt;
              }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
              .method public hidebysig instance default void edefaultstate_entry() cil managed&lt;br /&gt;
              {&lt;br /&gt;
                  .maxstack 500&lt;br /&gt;
                  .locals init (int32, int32, int32, float32, float32, class [ScriptTypes]LindenLab.SecondLife.Vector, class [mscorlib]System.Collections.ArrayList)&lt;br /&gt;
                  // integer x;&lt;br /&gt;
16                ldc.i4.0&lt;br /&gt;
13 00             stloc.s 0&lt;br /&gt;
&lt;br /&gt;
                  // integer y = 0;&lt;br /&gt;
20 00 00 00 00    ldc.i4 0&lt;br /&gt;
13 01             stloc.s 1&lt;br /&gt;
&lt;br /&gt;
                  // integer z;&lt;br /&gt;
16                ldc.i4.0&lt;br /&gt;
13 02             stloc.s 2&lt;br /&gt;
&lt;br /&gt;
                  // float f;&lt;br /&gt;
23 00 00 00 00    ldc.r8 0&lt;br /&gt;
00 00 00 00&lt;br /&gt;
13 03             stloc.s 3&lt;br /&gt;
&lt;br /&gt;
                  // float g;&lt;br /&gt;
23 00 00 00 00    ldc.r8 0&lt;br /&gt;
00 00 00 00&lt;br /&gt;
13 04             stloc.s 4&lt;br /&gt;
&lt;br /&gt;
                  // vector v;&lt;br /&gt;
23 00 00 00 00    ldc.r8 0&lt;br /&gt;
00 00 00 00&lt;br /&gt;
23 00 00 00 00    ldc.r8 0&lt;br /&gt;
00 00 00 00&lt;br /&gt;
23 00 00 00 00    ldc.r8 0&lt;br /&gt;
00 00 00 00&lt;br /&gt;
28 02 00 00 0A    call class [ScriptTypes]LindenLab.SecondLife.Vector class [LslUserScript]LindenLab.SecondLife.LslUserScript::&#039;CreateVector&#039;(float32, float32, float32)&lt;br /&gt;
13 05             stloc.s 5&lt;br /&gt;
&lt;br /&gt;
                  // list a;&lt;br /&gt;
28 03 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::CreateList()&lt;br /&gt;
13 06             stloc.s 6&lt;br /&gt;
&lt;br /&gt;
                  // ;;; {{{ }}} generate no code&lt;br /&gt;
&lt;br /&gt;
                  // return;&lt;br /&gt;
2A                ret&lt;br /&gt;
&lt;br /&gt;
                  // x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // (x);&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // (integer)x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // (float)x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
6C                conv.r8&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // f;&lt;br /&gt;
11 03             ldloc.s 3&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // (float)f;&lt;br /&gt;
11 03             ldloc.s 3&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // (integer)f;&lt;br /&gt;
11 03             ldloc.s 3&lt;br /&gt;
28 04 00 00 0A    call int32 [LslLibrary]LindenLab.SecondLife.LslRunTime::ToInteger(float32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // v;&lt;br /&gt;
11 05             ldloc.s 5&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // v.z;&lt;br /&gt;
12 05             ldloca.s 5&lt;br /&gt;
78 05 00 00 0A    ldfld float32 class [ScriptTypes]LindenLab.SecondLife.Vector::z&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // -x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
65                neg&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // ~x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
66                not&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // !x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
16                ldc.i4.0&lt;br /&gt;
FE 01             ceq&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // --x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
17                ldc.i4.1&lt;br /&gt;
59                sub&lt;br /&gt;
25                dup&lt;br /&gt;
13 00             stloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // ++x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
17                ldc.i4.1&lt;br /&gt;
58                add&lt;br /&gt;
25                dup&lt;br /&gt;
13 00             stloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x--;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
17                ldc.i4.1&lt;br /&gt;
59                sub&lt;br /&gt;
25                dup&lt;br /&gt;
13 00             stloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x++;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
17                ldc.i4.1&lt;br /&gt;
58                add&lt;br /&gt;
25                dup&lt;br /&gt;
13 00             stloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x = y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
25                dup&lt;br /&gt;
13 00             stloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x == y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
FE 01             ceq&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x = y = z;&lt;br /&gt;
11 02             ldloc.s 2&lt;br /&gt;
25                dup&lt;br /&gt;
13 01             stloc.s 1&lt;br /&gt;
25                dup&lt;br /&gt;
13 00             stloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // f = x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
6C                conv.r8&lt;br /&gt;
25                dup&lt;br /&gt;
13 03             stloc.s 3&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // f = (float)x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
6C                conv.r8&lt;br /&gt;
25                dup&lt;br /&gt;
13 03             stloc.s 3&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x != y; implemented as: !(x==y)&lt;br /&gt;
11 01             ldloc.s 1  // this part is x == y&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
FE 01             ceq&lt;br /&gt;
16                ldc.i4.0   // this part is &#039;not&#039;&lt;br /&gt;
FE 01             ceq&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x + y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
58                add&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x - y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
28 06 00 00 0A    call int32 [LslUserScript]LindenLab.SecondLife.LslUserScript::Subtract(int32, int32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x + -y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
65                neg&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
58                add&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x * y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
5A                mul&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x / y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
28 07 00 00 0A    call int32 [LslUserScript]LindenLab.SecondLife.LslUserScript::Divide(int32, int32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x % y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
28 08 00 00 0A    call int32 [LslUserScript]LindenLab.SecondLife.LslUserScript::Modulo(int32, int32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x &amp;amp; y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
5F                and&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x &amp;amp;&amp;amp; y; implemented as: !(!x | !y)&lt;br /&gt;
11 01             ldloc.s 1    // !x&lt;br /&gt;
16                ldc.i4.0&lt;br /&gt;
FE 01             ceq&lt;br /&gt;
11 00             ldloc.s 0    // !y&lt;br /&gt;
16                ldc.i4.0&lt;br /&gt;
FE 01             ceq&lt;br /&gt;
60                or           // !x | !y&lt;br /&gt;
16                ldc.i4.0     // !(!x | !y)&lt;br /&gt;
FE 01             ceq&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x | y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
60                or&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x || y; implemented as: !!(x | y)&lt;br /&gt;
11 01             ldloc.s 1    // x | y&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
60                or&lt;br /&gt;
16                ldc.i4.0     // !(x | y)&lt;br /&gt;
FE 01             ceq&lt;br /&gt;
16                ldc.i4.0     // !!(x | y)&lt;br /&gt;
FE 01             ceq&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x ^ y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
61                xor&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x &amp;lt;&amp;lt; y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
28 09 00 00 0A    call int32 [LslUserScript]LindenLab.SecondLife.LslUserScript::ShiftLeft(int32, int32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x &amp;gt;&amp;gt; y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
28 0A 00 00 0A    call int32 [LslUserScript]LindenLab.SecondLife.LslUserScript::ShiftRight(int32, int32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x &amp;lt; y; implemented as: y &amp;gt; x&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
FE 02             cgt&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x &amp;gt; y; implemented as: y &amp;lt; x;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
FE 04             clt&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x &amp;lt;= y; implemented as: !(y &amp;lt; x)&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
FE 04             clt&lt;br /&gt;
16                ldc.i4.0&lt;br /&gt;
FE 01             ceq&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x &amp;gt;= y; implemented as: !(y &amp;gt; x)&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
FE 02             cgt&lt;br /&gt;
16                ldc.i4.0&lt;br /&gt;
FE 01             ceq&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x += y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
58                add&lt;br /&gt;
25                dup&lt;br /&gt;
13 00             stloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x -= y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
28 06 00 00 0A    call int32 [LslUserScript]LindenLab.SecondLife.LslUserScript::Subtract(int32, int32)&lt;br /&gt;
25                dup&lt;br /&gt;
13 00             stloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x += -y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
65                neg&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
58                add&lt;br /&gt;
25                dup&lt;br /&gt;
13 00             stloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x *= y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
5A                mul&lt;br /&gt;
25                dup&lt;br /&gt;
13 00             stloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x /= y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
28 07 00 00 0A    call int32 [LslUserScript]LindenLab.SecondLife.LslUserScript::Divide(int32, int32)&lt;br /&gt;
25                dup&lt;br /&gt;
13 00             stloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x %= y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
28 08 00 00 0A    call int32 [LslUserScript]LindenLab.SecondLife.LslUserScript::Modulo(int32, int32)&lt;br /&gt;
25                dup&lt;br /&gt;
13 00             stloc.s 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // if (x) ;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
39 00 00 00 00    brfalse LabelTempJump0&lt;br /&gt;
                  // THEN branch code goes here&lt;br /&gt;
              LabelTempJump0:&lt;br /&gt;
&lt;br /&gt;
                  // if (x) ; else ;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
39 05 00 00 00    brfalse LabelTempJump1&lt;br /&gt;
                  // THEN branch code would go here&lt;br /&gt;
38 00 00 00 00    br LabelTempJump2&lt;br /&gt;
                  // ELSE branch code would go here&lt;br /&gt;
              LabelTempJump1:&lt;br /&gt;
              LabelTempJump2:&lt;br /&gt;
&lt;br /&gt;
                  // 0;&lt;br /&gt;
20 00 00 00 00    ldc.i4 0&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x ^ x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
61                xor&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // 1;&lt;br /&gt;
20 01 00 00 00    ldc.i4 1&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // -1; note the negative sign takes code memory&lt;br /&gt;
20 01 00 00 00    ldc.i4 1&lt;br /&gt;
65                neg&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // 0xffffffff; note it equals -1 without the sign taking memory&lt;br /&gt;
20 FF FF FF FF    ldc.i4 -1&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // ALL_SIDES; ditto&lt;br /&gt;
20 FF FF FF FF    ldc.i4 -1&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x | ~x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
66                not&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
60                or&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x + 1;&lt;br /&gt;
20 01 00 00 00    ldc.i4 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
58                add&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // -~x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
66                not&lt;br /&gt;
65                neg&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x - 1;&lt;br /&gt;
20 01 00 00 00    ldc.i4 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
28 06 00 00 0A    call int32 [LslUserScript]LindenLab.SecondLife.LslUserScript::Subtract(int32, int32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x + -1;&lt;br /&gt;
20 01 00 00 00    ldc.i4 1&lt;br /&gt;
65                neg&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
58                add&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // ~-x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
65                neg&lt;br /&gt;
66                not&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x*y + y - 1;&lt;br /&gt;
20 01 00 00 00    ldc.i4 1&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
5A                mul&lt;br /&gt;
58                add&lt;br /&gt;
28 06 00 00 0A    call int32 [LslUserScript]LindenLab.SecondLife.LslUserScript::Subtract(int32, int32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // (x + 1)*y - 1;&lt;br /&gt;
20 01 00 00 00    ldc.i4 1&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
20 01 00 00 00    ldc.i4 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
58                add&lt;br /&gt;
5A                mul&lt;br /&gt;
28 06 00 00 0A    call int32 [LslUserScript]LindenLab.SecondLife.LslUserScript::Subtract(int32, int32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // ~(~x*y);&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
66                not&lt;br /&gt;
5A                mul&lt;br /&gt;
66                not&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // while (x) ;&lt;br /&gt;
              LabelTempJump3:&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
39 05 00 00 00    brfalse LabelTempJump4&lt;br /&gt;
                  // Looped code would go here&lt;br /&gt;
38 F4 FF FF FF    br LabelTempJump3&lt;br /&gt;
              LabelTempJump4:&lt;br /&gt;
&lt;br /&gt;
                  // do ; while (x);&lt;br /&gt;
              LabelTempJump5:&lt;br /&gt;
                  // Looped code would go here&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
3A F9 FF FF FF    brtrue LabelTempJump5&lt;br /&gt;
&lt;br /&gt;
                  // for (; x; ) ;&lt;br /&gt;
              LabelTempJump6:&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
39 05 00 00 00    brfalse LabelTempJump7&lt;br /&gt;
                  // Looped code would go here&lt;br /&gt;
38 F4 FF FF FF    br LabelTempJump6&lt;br /&gt;
              LabelTempJump7:&lt;br /&gt;
&lt;br /&gt;
                  // @label; if (x) jump label;&lt;br /&gt;
              &#039;label&#039;:&lt;br /&gt;
                  // Looped code would go here&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
39 05 00 00 00    brfalse LabelTempJump8&lt;br /&gt;
38 F4 FF FF FF    br &#039;label&#039;&lt;br /&gt;
              LabelTempJump8:&lt;br /&gt;
&lt;br /&gt;
                  // 0.0;&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 00 00)&lt;br /&gt;
00 00 00 00&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // f = 0.0;&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 00 00)&lt;br /&gt;
00 00 00 00&lt;br /&gt;
25                dup&lt;br /&gt;
13 03             stloc.s 3&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // f = 0;&lt;br /&gt;
20 00 00 00 00    ldc.i4 0&lt;br /&gt;
6C                conv.r8&lt;br /&gt;
25                dup&lt;br /&gt;
13 03             stloc.s 3&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // &amp;lt;0.0, 0.0, 0.0&amp;gt;;&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 00 00)&lt;br /&gt;
00 00 00 00&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 00 00)&lt;br /&gt;
00 00 00 00&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 00 00)&lt;br /&gt;
00 00 00 00&lt;br /&gt;
28 02 00 00 0A    call class [ScriptTypes]LindenLab.SecondLife.Vector class [LslUserScript]LindenLab.SecondLife.LslUserScript::&#039;CreateVector&#039;(float32, float32, float32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // ZERO_VECTOR;&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 00 00)&lt;br /&gt;
00 00 00 00&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 00 00)&lt;br /&gt;
00 00 00 00&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 00 00)&lt;br /&gt;
00 00 00 00&lt;br /&gt;
28 02 00 00 0A    call class [ScriptTypes]LindenLab.SecondLife.Vector class [LslUserScript]LindenLab.SecondLife.LslUserScript::&#039;CreateVector&#039;(float32, float32, float32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // &amp;lt;0, 0, 0&amp;gt;;&lt;br /&gt;
20 00 00 00 00    ldc.i4 0&lt;br /&gt;
6C                conv.r8&lt;br /&gt;
20 00 00 00 00    ldc.i4 0&lt;br /&gt;
6C                conv.r8&lt;br /&gt;
20 00 00 00 00    ldc.i4 0&lt;br /&gt;
6C                conv.r8&lt;br /&gt;
28 02 00 00 0A    call class [ScriptTypes]LindenLab.SecondLife.Vector class [LslUserScript]LindenLab.SecondLife.LslUserScript::&#039;CreateVector&#039;(float32, float32, float32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // &amp;lt;-1.0, -1.0, 0.0&amp;gt;;&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 f0 3f)&lt;br /&gt;
00 00 F0 3F&lt;br /&gt;
65                neg&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 f0 3f)&lt;br /&gt;
00 00 F0 3F&lt;br /&gt;
65                neg&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 00 00)&lt;br /&gt;
00 00 00 00&lt;br /&gt;
28 02 00 00 0A    call class [ScriptTypes]LindenLab.SecondLife.Vector class [LslUserScript]LindenLab.SecondLife.LslUserScript::&#039;CreateVector&#039;(float32, float32, float32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // TOUCH_INVALID_TEXCOORD;&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 f0 bf)&lt;br /&gt;
00 00 F0 BF&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 f0 bf)&lt;br /&gt;
00 00 F0 BF&lt;br /&gt;
23 00 00 00 00    ldc.r8 (00 00 00 00 00 00 00 00)&lt;br /&gt;
00 00 00 00&lt;br /&gt;
28 02 00 00 0A    call class [ScriptTypes]LindenLab.SecondLife.Vector class [LslUserScript]LindenLab.SecondLife.LslUserScript::&#039;CreateVector&#039;(float32, float32, float32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // &amp;lt;-1, -1, 0&amp;gt;;&lt;br /&gt;
20 01 00 00 00    ldc.i4 1&lt;br /&gt;
65                neg&lt;br /&gt;
6C                conv.r8&lt;br /&gt;
20 01 00 00 00    ldc.i4 1&lt;br /&gt;
65                neg&lt;br /&gt;
6C                conv.r8&lt;br /&gt;
20 00 00 00 00    ldc.i4 0&lt;br /&gt;
6C                conv.r8&lt;br /&gt;
28 02 00 00 0A    call class [ScriptTypes]LindenLab.SecondLife.Vector class [LslUserScript]LindenLab.SecondLife.LslUserScript::&#039;CreateVector&#039;(float32, float32, float32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // &amp;lt;0xffffffff, 0xffffffff, 0&amp;gt;;&lt;br /&gt;
20 FF FF FF FF    ldc.i4 -1&lt;br /&gt;
6C                conv.r8&lt;br /&gt;
20 FF FF FF FF    ldc.i4 -1&lt;br /&gt;
6C                conv.r8&lt;br /&gt;
20 00 00 00 00    ldc.i4 0&lt;br /&gt;
6C                conv.r8&lt;br /&gt;
28 02 00 00 0A    call class [ScriptTypes]LindenLab.SecondLife.Vector class [LslUserScript]LindenLab.SecondLife.LslUserScript::&#039;CreateVector&#039;(float32, float32, float32)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // v + v;&lt;br /&gt;
11 05             ldloc.s 5&lt;br /&gt;
11 05             ldloc.s 5&lt;br /&gt;
28 0B 00 00 0A    call class [ScriptTypes]LindenLab.SecondLife.Vector class [LslUserScript]LindenLab.SecondLife.LslUserScript::&#039;Add&#039;(class [ScriptTypes]LindenLab.SecondLife.Vector, class [ScriptTypes]LindenLab.SecondLife.Vector)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // v - v;&lt;br /&gt;
11 05             ldloc.s 5&lt;br /&gt;
11 05             ldloc.s 5&lt;br /&gt;
28 0C 00 00 0A    call class [ScriptTypes]LindenLab.SecondLife.Vector class [LslUserScript]LindenLab.SecondLife.LslUserScript::&#039;Subtract&#039;(class [ScriptTypes]LindenLab.SecondLife.Vector, class [ScriptTypes]LindenLab.SecondLife.Vector)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // v * v;&lt;br /&gt;
11 05             ldloc.s 5&lt;br /&gt;
11 05             ldloc.s 5&lt;br /&gt;
28 0D 00 00 0A    call float32 class [LslUserScript]LindenLab.SecondLife.LslUserScript::&#039;Multiply&#039;(class [ScriptTypes]LindenLab.SecondLife.Vector, class [ScriptTypes]LindenLab.SecondLife.Vector)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // v % v;&lt;br /&gt;
11 05             ldloc.s 5&lt;br /&gt;
11 05             ldloc.s 5&lt;br /&gt;
28 0E 00 00 0A    call class [ScriptTypes]LindenLab.SecondLife.Vector class [LslUserScript]LindenLab.SecondLife.LslUserScript::&#039;Modulo&#039;(class [ScriptTypes]LindenLab.SecondLife.Vector, class [ScriptTypes]LindenLab.SecondLife.Vector)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // [];&lt;br /&gt;
28 03 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::CreateList()&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // a = [];&lt;br /&gt;
28 03 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::CreateList()&lt;br /&gt;
25                dup&lt;br /&gt;
13 06             stloc.s 6&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // a + [x];&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
8C 01 00 00 1B    box [mscorlib]System.Int32&lt;br /&gt;
28 03 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::CreateList()&lt;br /&gt;
28 0F 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::Prepend(object, class [mscorlib]System.Collections.ArrayList)&lt;br /&gt;
11 06             ldloc.s 6&lt;br /&gt;
28 10 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::Append(class [mscorlib]System.Collections.ArrayList, class [mscorlib]System.Collections.ArrayList)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // a + x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
11 06             ldloc.s 6&lt;br /&gt;
28 11 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::Append(int32, class [mscorlib]System.Collections.ArrayList)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // [x] + a;&lt;br /&gt;
11 06             ldloc.s 6&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
8C 01 00 00 1B    box [mscorlib]System.Int32&lt;br /&gt;
28 03 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::CreateList()&lt;br /&gt;
28 0F 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::Prepend(object, class [mscorlib]System.Collections.ArrayList)&lt;br /&gt;
28 10 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::Append(class [mscorlib]System.Collections.ArrayList, class [mscorlib]System.Collections.ArrayList)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // x + a;&lt;br /&gt;
11 06             ldloc.s 6&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
8C 01 00 00 1B    box [mscorlib]System.Int32&lt;br /&gt;
28 12 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::Prepend(class [mscorlib]System.Collections.ArrayList, object)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // [x];&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
8C 01 00 00 1B    box [mscorlib]System.Int32&lt;br /&gt;
28 03 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::CreateList()&lt;br /&gt;
28 0F 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::Prepend(object, class [mscorlib]System.Collections.ArrayList)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // []+x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
28 03 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::CreateList()&lt;br /&gt;
28 11 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::Append(int32, class [mscorlib]System.Collections.ArrayList)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // (list)x;&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
8C 01 00 00 1B    box [mscorlib]System.Int32&lt;br /&gt;
28 13 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::CreateList(object)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // [x, y];&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
8C 01 00 00 1B    box [mscorlib]System.Int32&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
8C 01 00 00 1B    box [mscorlib]System.Int32&lt;br /&gt;
28 03 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::CreateList()&lt;br /&gt;
28 0F 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::Prepend(object, class [mscorlib]System.Collections.ArrayList)&lt;br /&gt;
28 0F 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::Prepend(object, class [mscorlib]System.Collections.ArrayList)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // []+x+y;&lt;br /&gt;
11 01             ldloc.s 1&lt;br /&gt;
11 00             ldloc.s 0&lt;br /&gt;
28 03 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::CreateList()&lt;br /&gt;
28 11 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::Append(int32, class [mscorlib]System.Collections.ArrayList)&lt;br /&gt;
28 11 00 00 0A    call class [mscorlib]System.Collections.ArrayList class [LslUserScript]LindenLab.SecondLife.LslUserScript::Append(int32, class [mscorlib]System.Collections.ArrayList)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // (string)a;&lt;br /&gt;
11 06             ldloc.s 6&lt;br /&gt;
28 14 00 00 0A    call string [LslLibrary]LindenLab.SecondLife.LslRunTime::ListToString(class [mscorlib]System.Collections.ArrayList)&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // i;&lt;br /&gt;
02                ldarg.0&lt;br /&gt;
7B 01 00 00 04    ldfld int32 LSL_y::&#039;i&#039;&lt;br /&gt;
26                pop&lt;br /&gt;
&lt;br /&gt;
                  // u();&lt;br /&gt;
02                ldarg.0&lt;br /&gt;
28 02 00 00 06    call instance void class LSL_y::&#039;gu&#039;()&lt;br /&gt;
&lt;br /&gt;
                  // end of event&lt;br /&gt;
2A                ret&lt;br /&gt;
              }&lt;br /&gt;
&lt;br /&gt;
          }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Important notes: =====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;ldloc.s 0&amp;lt;/code&amp;gt; (opcode 11, argument 00) is probably contracted to the abbreviation &amp;lt;code&amp;gt;ldloc.0&amp;lt;/code&amp;gt; (opcode 06) at assembly time, resulting in the length of 2 obtained in the [[User:Pedro Oval/Mono code memory usage|memory usage tests]]. Or possibly the server-side compiler added an optimization of this case (!). Either way, the evidence for this is confirmed by the fact that &amp;lt;code&amp;gt;x;&amp;lt;/code&amp;gt; takes 2 bytes if it&#039;s one of the first four local variables (there are 1-byte opcodes for ldloc.0 through ldloc.3), and 3 bytes otherwise. This applies to all appearances of this opcode and the similar &amp;lt;code&amp;gt;stloc.s&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Local variable definitions seem to take a variable and big number of bytes (averaging about 47 bytes for local integers) if there is a function call anywhere in the event in which they are defined. Reason unknown.&lt;br /&gt;
* Backward jumps seem to take many more bytes than what the CIL result above suggests. Forward jumps, however, seem predictable enough.&lt;br /&gt;
* As things are now, having more than 256 local variables in a single function or event causes wraparound, making the 257th be an alias to the 1st, and so on. If they aren&#039;t the same type, the script crashes at runtime with an uncaught exception. That&#039;s a consequence of using &amp;lt;code&amp;gt;ldloc.s&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;stloc.s&amp;lt;/code&amp;gt; without switching to the long version (&amp;lt;code&amp;gt;ldloc&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;stloc&amp;lt;/code&amp;gt;) when the argument is greater than 255.&lt;br /&gt;
&lt;br /&gt;
===== Additional memory usage notes: =====&lt;br /&gt;
* Global variable, function, and function parameter names do take code memory from the script (as part of some symbol table). Fortunately they take 1 byte per character only, as opposed to Mono strings, which take at least 2 bytes per character (they are UTF-16). That extra code is only taken once per variable, regardless of how many times it is used.&lt;br /&gt;
* In addition to the state code and state change command code, the state names themselves take code memory from the script, as follows:&lt;br /&gt;
** The state name by itself takes no code memory, but internally, each event name includes the state name. The internal name for the event is e.g. &amp;lt;code&amp;gt;edefaultstate_entry&amp;lt;/code&amp;gt; (for state &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt;, event &amp;lt;code&amp;gt;state_entry&amp;lt;/code&amp;gt;), &amp;lt;code&amp;gt;eblahtimer&amp;lt;/code&amp;gt; (for state blah, event &amp;lt;code&amp;gt;timer&amp;lt;/code&amp;gt;). These names take 1 byte per character.&lt;br /&gt;
** If a state switch statement appears in the code, the state name takes additionally 2 bytes per character. (But these strings are reused, so multiple state switch statements don&#039;t take additional space for the strings.)&lt;br /&gt;
&lt;br /&gt;
Although not mentioned above, every single-byte string needs an additional terminating zero byte, and every UTF-16 string needs an additional length prefix byte (or more if longer than 127 bytes, i.e. 63 characters if in the ASCII range) plus an additional terminating zero byte.&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Talk:LlGetNumberOfSides&amp;diff=1193721</id>
		<title>Talk:LlGetNumberOfSides</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Talk:LlGetNumberOfSides&amp;diff=1193721"/>
		<updated>2014-10-04T12:47:31Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: Confirm and refine finding&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Threshold of cut to detect its lips: for instance a cube , hollow 0.95, the cut must be smaller than 0.99. I have not checked the full rules, but it would be nice this to be specified somewhere[[User:Sigma Avro|Sigma Avro]] 22:23, 2 October 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
:Hollow doesn&#039;t matter. I can confirm that the server won&#039;t create new faces unless &amp;lt;code&amp;gt;cut_end - cut_begin &amp;lt; 0.99&amp;lt;/code&amp;gt;. That&#039;s an approximate rule, as &amp;lt;code&amp;gt;cut_begin = 0.000001&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;cut_end = 0.99&amp;lt;/code&amp;gt; will &#039;&#039;not&#039;&#039; create a new face anyway, even if they meet the condition (not sure why, maybe the server is rounding values too close to zero or one). The viewer, on the other hand, won&#039;t create new faces unless &amp;lt;code&amp;gt;llRound(cut_end*65536) - llRound(cut_begin*65536) &amp;amp;lt; 64880&amp;lt;/code&amp;gt;; that formula makes sense because PathBegin and PathEnd are 16-bit unsigned elements when transmitted to the viewer through an [[ObjectUpdate]] message. --[[User:Pedro Oval|Pedro Oval]] 05:47, 4 October 2014 (PDT)&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlTargetOmega_Replacement&amp;diff=1193720</id>
		<title>LlTargetOmega Replacement</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlTargetOmega_Replacement&amp;diff=1193720"/>
		<updated>2014-10-04T11:15:12Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: Style&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL_Function&lt;br /&gt;
|func=KeyFramedOmega&lt;br /&gt;
|func_id&lt;br /&gt;
|func_sleep&lt;br /&gt;
|func_energy&lt;br /&gt;
|func_desc=Rotates the object/prim around axis at a rate of spinrate in radians per second&lt;br /&gt;
|func_footnote&lt;br /&gt;
|return_type&lt;br /&gt;
|return_text&lt;br /&gt;
|p1_type=vector&lt;br /&gt;
|p1_name=axis&lt;br /&gt;
|p1_desc=arbitrary axis to rotate the object around&lt;br /&gt;
|p1_hover&lt;br /&gt;
|p2_type=float&lt;br /&gt;
|p2_name=spinrate&lt;br /&gt;
|p2_desc=rate of rotation in radians per second&lt;br /&gt;
|p2_hover&lt;br /&gt;
|constants&lt;br /&gt;
|spec=&lt;br /&gt;
* This doesn&#039;t make [[llTargetOmega]] redundant but in some cases a Key Framed motion may be preferred&lt;br /&gt;
* The routine: &amp;quot;KeyFramedOmega&amp;quot; is easy to use for [[llTargetOmega]]: It takes the first two parameters in [[llTargetOmega]]: axis and spinrate&lt;br /&gt;
* All viewers will see the same spin and rotation&lt;br /&gt;
* The object will keep the rotation it has when spin is stopped&lt;br /&gt;
* A spin will continue even when the script is deleted&lt;br /&gt;
|caveats=&lt;br /&gt;
* The script must be in the root prim&lt;br /&gt;
* It can not spin child prims&lt;br /&gt;
* The object must be convex hull physics type&lt;br /&gt;
* Can not spin physical objects&lt;br /&gt;
* If the center of mass is not at the center of the root, the object will shake and jerk and drift erratically ([https://jira.secondlife.com/browse/BUG-7266 BUG-7266])&lt;br /&gt;
|examples=&lt;br /&gt;
This script shows how to use the routine to start, stop and reverse a spin on repeated touches&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// llTargetOmega substitution by Dora Gustafson, Studio Dora 2014&lt;br /&gt;
&lt;br /&gt;
integer P;&lt;br /&gt;
&lt;br /&gt;
KeyFramedOmega( vector axis, float spinrate)&lt;br /&gt;
{&lt;br /&gt;
    llSetKeyframedMotion( [], []);&lt;br /&gt;
    if ( spinrate )&lt;br /&gt;
    {&lt;br /&gt;
        float v = TWO_PI/3.0;&lt;br /&gt;
        if ( spinrate &amp;lt; 0 ) v = -v;&lt;br /&gt;
        list L = [llAxisAngle2Rot( axis/llGetRot(), v), v/spinrate];&lt;br /&gt;
        llSetKeyframedMotion( L+L+L, [KFM_DATA, KFM_ROTATION, KFM_MODE, KFM_LOOP]);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetPrimitiveParams([PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]);&lt;br /&gt;
    }&lt;br /&gt;
    touch_end( integer n)&lt;br /&gt;
    {&lt;br /&gt;
        P = ++P%4;&lt;br /&gt;
        if ( P == 1 ) KeyFramedOmega( &amp;lt;0,0,1&amp;gt;, 2.0);       // Positive spin&lt;br /&gt;
        else if ( P == 3 ) KeyFramedOmega( &amp;lt;0,0,1&amp;gt;, -2.0); // Negative spin&lt;br /&gt;
        else KeyFramedOmega( &amp;lt;0,0,1&amp;gt;, 0.0);                // Stop spin&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
|helpers&lt;br /&gt;
|also_header&lt;br /&gt;
|also_functions=: [[llTargetOmega]]&lt;br /&gt;
: [[llSetKeyframedMotion]]&lt;br /&gt;
|also_tests&lt;br /&gt;
|also_events&lt;br /&gt;
|also_articles&lt;br /&gt;
|also_footer&lt;br /&gt;
|notes=The magnitude of &#039;&#039;axis&#039;&#039; do &#039;&#039;&#039;not&#039;&#039;&#039; influence the &#039;&#039;spinrate&#039;&#039;&lt;br /&gt;
|mode=user&lt;br /&gt;
|deprecated&lt;br /&gt;
|location=[[User:Dora_Gustafson/Replacing_llTargetOmega/function|The Function]]&lt;br /&gt;
|cat1=Rotation&lt;br /&gt;
|cat2=Examples&lt;br /&gt;
|signature=[[User:Dora Gustafson|Dora Gustafson]] 04:36, 12 August 2014 (PDT)&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlTargetOmega_Replacement&amp;diff=1193689</id>
		<title>LlTargetOmega Replacement</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlTargetOmega_Replacement&amp;diff=1193689"/>
		<updated>2014-10-01T17:32:53Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: Bug caveat&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL_Function&lt;br /&gt;
|func=KeyFramedOmega&lt;br /&gt;
|func_id&lt;br /&gt;
|func_sleep&lt;br /&gt;
|func_energy&lt;br /&gt;
|func_desc=Rotates the object/prim around axis at a rate of spinrate in radians per second&lt;br /&gt;
|func_footnote&lt;br /&gt;
|return_type&lt;br /&gt;
|return_text&lt;br /&gt;
|p1_type=vector&lt;br /&gt;
|p1_name=axis&lt;br /&gt;
|p1_desc=arbitrary axis to rotate the object around&lt;br /&gt;
|p1_hover&lt;br /&gt;
|p2_type=float&lt;br /&gt;
|p2_name=spinrate&lt;br /&gt;
|p2_desc=rate of rotation in radians per second&lt;br /&gt;
|p2_hover&lt;br /&gt;
|constants&lt;br /&gt;
|spec=&lt;br /&gt;
: This doesn&#039;t make [[llTargetOmega]] redundant but in some cases a Key Framed motion may be preferred&lt;br /&gt;
: The routine: &amp;quot;KeyFramedOmega&amp;quot; is easy to use for [[llTargetOmega]]: It takes the first two parameters in [[llTargetOmega]]: axis and spinrate&lt;br /&gt;
: All viewers will see the same spin and rotation&lt;br /&gt;
: The object will keep the rotation it has when spin is stopped&lt;br /&gt;
: A spin will continue even when the script is deleted&lt;br /&gt;
|caveats=&lt;br /&gt;
: The script must be in the root prim&lt;br /&gt;
: It can not spin child prims&lt;br /&gt;
: The object must be convex hull physics type&lt;br /&gt;
: Can not spin physical objects&lt;br /&gt;
: If the center of mass is not at the center of the root, the object will shake and jerk and drift erratically ([https://jira.secondlife.com/browse/BUG-7266 BUG-7266])&lt;br /&gt;
|examples=&lt;br /&gt;
This script shows how to use the routine to start, stop and reverse a spin on repeated touches&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// llTargetOmega substitution by Dora Gustafson, Studio Dora 2014&lt;br /&gt;
&lt;br /&gt;
integer P;&lt;br /&gt;
&lt;br /&gt;
KeyFramedOmega( vector axis, float spinrate)&lt;br /&gt;
{&lt;br /&gt;
    llSetKeyframedMotion( [], []);&lt;br /&gt;
    if ( spinrate )&lt;br /&gt;
    {&lt;br /&gt;
        float v = TWO_PI/3.0;&lt;br /&gt;
        if ( spinrate &amp;lt; 0 ) v = -v;&lt;br /&gt;
        list L = [llAxisAngle2Rot( axis/llGetRot(), v), v/spinrate];&lt;br /&gt;
        llSetKeyframedMotion( L+L+L, [KFM_DATA, KFM_ROTATION, KFM_MODE, KFM_LOOP]);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSetPrimitiveParams([PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]);&lt;br /&gt;
    }&lt;br /&gt;
    touch_end( integer n)&lt;br /&gt;
    {&lt;br /&gt;
        P = ++P%4;&lt;br /&gt;
        if ( P == 1 ) KeyFramedOmega( &amp;lt;0,0,1&amp;gt;, 2.0);       // Positive spin&lt;br /&gt;
        else if ( P == 3 ) KeyFramedOmega( &amp;lt;0,0,1&amp;gt;, -2.0); // Negative spin&lt;br /&gt;
        else KeyFramedOmega( &amp;lt;0,0,1&amp;gt;, 0.0);                // Stop spin&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/lsl&amp;gt;&lt;br /&gt;
|helpers&lt;br /&gt;
|also_header&lt;br /&gt;
|also_functions=: [[llTargetOmega]]&lt;br /&gt;
: [[llSetKeyframedMotion]]&lt;br /&gt;
|also_tests&lt;br /&gt;
|also_events&lt;br /&gt;
|also_articles&lt;br /&gt;
|also_footer&lt;br /&gt;
|notes=The magnitude of &#039;&#039;axis&#039;&#039; do &#039;&#039;&#039;not&#039;&#039;&#039; influence the &#039;&#039;spinrate&#039;&#039;&lt;br /&gt;
|mode=user&lt;br /&gt;
|deprecated&lt;br /&gt;
|location=[[User:Dora_Gustafson/Replacing_llTargetOmega/function|The Function]]&lt;br /&gt;
|cat1=Rotation&lt;br /&gt;
|cat2=Examples&lt;br /&gt;
|signature=[[User:Dora Gustafson|Dora Gustafson]] 04:36, 12 August 2014 (PDT)&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=Talk:UTF-8&amp;diff=1193688</id>
		<title>Talk:UTF-8</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=Talk:UTF-8&amp;diff=1193688"/>
		<updated>2014-10-01T17:22:45Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: /* Testing and Usage */ On the gritty little details&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Testing and Usage ==&lt;br /&gt;
&lt;br /&gt;
Yeah I always stayed away from the weird ranges. These functions were mostly written with LSO in mind, and LSO did no special conversions. LSO was happy with 6 byte character codes (old UTF-8). Mono is another thing altogether. The only testing I did for Mono was to make sure it compiled correctly and the logic executed the same. I did not do the extensive testing for Mono that I did for LSO. For LSO these functions were pretty much mirrors but I always tested the range of characters I was going to be using to make sure, and I always stayed away from ranges that do things.&lt;br /&gt;
&lt;br /&gt;
Should I make a version for surrogate pairs? (on second thought do I want to learn enough about surrogate pairs to write a function for them?) -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 21:08, 29 September 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
:LSO uses byte strings and does not care about the validity of the Unicode codepoints they represent. You can even store an incomplete UTF-8 sequence such as &amp;lt;code&amp;gt;llUnescapeURL(&amp;quot;%C3&amp;quot;)&amp;lt;/code&amp;gt; in LSO. For that reason, the conversion to/from integer is safe in LSO, being able to encode every code point between U+0001 and U+7FFFFFFF. This line works fine under LSO, proving the conversion is working flawlessly: &amp;lt;code&amp;gt;llOwnerSay((string)UTF8ToUnicodeInteger(UnicodeIntegerToUTF8(0x7FFFFFFF)));&amp;lt;/code&amp;gt; displays 2147483647 as expected. Surrogates and U+FFFE are encoded and decoded without problems.&lt;br /&gt;
:Mono, on the other hand, uses UTF-16 internally for its strings, and respects Unicode rules with respect to validity. Thus surrogates and U+FFFE are invalid.&lt;br /&gt;
:I don&#039;t know how &amp;quot;a version for surrogate pairs&amp;quot; would look like. I don&#039;t see how a function can be made to work under Mono that allows mapping of the range U+D800-U+DFFF to a two-byte character in UTF-16 losslessly. Or that would allow the range above 0x10FFFF to be mapped to a valid Unicode string, for the matter. At least not without using escapes, i.e. reinventing the wheel. For the record, a UTF-8 sequence that would produce a surrogate (e.g. &amp;lt;code&amp;gt;llUnescapeURL(&amp;quot;%ED%A0%80&amp;quot;)&amp;lt;/code&amp;gt;) translates to &amp;quot;???&amp;quot; in Mono. --[[User:Pedro Oval|Pedro Oval]] 03:40, 30 September 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
::I&#039;m really ok with you documenting every gritty little detail of Mono and where these functions fail. Seriously, please do. Its interesting stuff. You might, if you haven&#039;t already, want to look at how Mono implemented its string libraries. -- &#039;&#039;&#039;[[User:Strife_Onizuka|Strife]]&#039;&#039;&#039; &amp;lt;sup&amp;gt;&amp;lt;small&amp;gt;([[User talk:Strife_Onizuka|talk]]|[[Special:Contributions/Strife_Onizuka|contribs]])&amp;lt;/small&amp;gt;&amp;lt;/sup&amp;gt; 13:26, 30 September 2014 (PDT)&lt;br /&gt;
&lt;br /&gt;
:::For the record, it&#039;s not what I intended to do. I was tempted to remove the whole section added by Ollj Oh, but decided to try to salvage the part that was not misleading and was perhaps useful. --[[User:Pedro Oval|Pedro Oval]] 10:22, 1 October 2014 (PDT)&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=UTF-8&amp;diff=1193687</id>
		<title>UTF-8</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=UTF-8&amp;diff=1193687"/>
		<updated>2014-10-01T17:15:33Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: /* Limits under Mono */ Minor nitpick&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL Header}}{{LSLC|User-Defined_Functions}}&lt;br /&gt;
Second Life uses {{Wikipedia|UTF-8|UTF-8}} for storing and transmitting [[String|strings]] and with these functions you can work with {{Wikipedia|Unicode|Unicode}} characters. See: [[Unicode In 5 Minutes]] for a brief introduction to {{Wikipedia|Unicode|Unicode}}.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These functions are part of the [[Combined Library]] written by {{User|Strife Onizuka}}.&lt;br /&gt;
&lt;br /&gt;
== Limits under Mono ==&lt;br /&gt;
&lt;br /&gt;
One of the side effects of using the Mono VM is that the string encoding used is not the archaic version of UTF-8 that the LSO VM uses, but instead is a much later version of UTF-16. The important difference is that some ranges of values that could be encoded in the old UTF-8 are not well supported in Mono&#039;s UTF-16 implementation. This means some values that worked with these functions in LSO, will not work under Mono.&lt;br /&gt;
&lt;br /&gt;
Unless you are using these functions to pack data in strings you are unlikely to ever need to know or worry about this.&lt;br /&gt;
&lt;br /&gt;
Some background: Unicode predominately contains simple characters. However some Unicode values do not represent characters but have special meaning within the Unicode Specification. Under Mono these results in one or more question marks (&amp;quot;?&amp;quot;). UnicodeIntegerToUTF8 and UTF8ToUnicodeInteger work perfectly for the simple characters; however not so well for the other values. More on these ranges can be found in the [http://unicode.org Unicode] specification and [http://en.wikipedia.org/wiki/Specials_%28Unicode_block%29 Specials (Unicode block)]. While LSO doesn&#039;t care about these limitations, Mono does.&lt;br /&gt;
&lt;br /&gt;
The following integer ranges are where UTF8ToUnicodeInteger() and UnicodeIntegerToUTF8() are NOT inverse functions of each other under Mono.&lt;br /&gt;
Converting these integers to utf8 and back to integer may likely result in the integer 63 (the Unicode codepoint for &amp;quot;?&amp;quot;), no longer guaranteeing uniqueness:&lt;br /&gt;
&lt;br /&gt;
* [55296..57343] (2048 values). This corresponds to the surrogate area U+D800-U+DFFF, which is a reserved range because it&#039;s used by UTF-16 to represent the code points above U+FFFF.&lt;br /&gt;
* [65534] U+FFFE is in fact THE intentionally &amp;quot;INVALID CHARACTER&amp;quot; Unicode code point. It is invalid by design.&lt;br /&gt;
* [1114112 and above] can&#039;t be encoded because the Unicode range stops at U+10FFFF.&lt;br /&gt;
&lt;br /&gt;
== Standard ==&lt;br /&gt;
&lt;br /&gt;
This version of UnicodeIntegerToUTF8 complies to the latest standard. [[LSO]] on the other hand complies to an earlier standard. The newer standard includes only a subset of the older standard. The extended range of the old standard went unused so this incompleteness is moot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;string UnicodeIntegerToUTF8(integer input)//Mono Safe, LSLEditor Safe, LSO Incomplete&lt;br /&gt;
{//LSO allows for the older UTF-8 range, this function only supports the new UTF-16 range.&lt;br /&gt;
    if(input &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        if(input &amp;lt;= 0x7FF)&lt;br /&gt;
        {//instead of a flat if else chain, this redistributes the fork load so that only the 4 byte characters result in 3 forks, all the other paths are 2 forks.&lt;br /&gt;
            if(input &amp;lt;= 0x7F){&lt;br /&gt;
                input = input &amp;lt;&amp;lt; 24;&lt;br /&gt;
                jump quick_return;//saves us from the implicit double jump that using an else would cause.&lt;br /&gt;
            }&lt;br /&gt;
            input = 0xC0800000 | ((input &amp;lt;&amp;lt; 18) &amp;amp; 0x1F000000) | ((input &amp;lt;&amp;lt; 16) &amp;amp; 0x3F0000);&lt;br /&gt;
        }&lt;br /&gt;
        else if(input &amp;lt;= 0xFFFF)&lt;br /&gt;
            input = 0xE0808000 | ((input &amp;lt;&amp;lt; 12) &amp;amp; 0x0F000000) | ((input &amp;lt;&amp;lt; 10) &amp;amp; 0x3F0000) | ((input &amp;lt;&amp;lt; 8) &amp;amp; 0x3F00);&lt;br /&gt;
        else if(input &amp;lt;= 0x10FFFF)&lt;br /&gt;
            input = 0xF0808080 | ((input &amp;lt;&amp;lt; 06) &amp;amp; 0x07000000) | ((input &amp;lt;&amp;lt; 04) &amp;amp; 0x3F0000) | ((input &amp;lt;&amp;lt; 2) &amp;amp; 0x3F00) | (input &amp;amp; 0x3F);&lt;br /&gt;
        else&lt;br /&gt;
            jump error;//not in our range&lt;br /&gt;
        @quick_return;&lt;br /&gt;
        return llBase64ToString(llIntegerToBase64(input));&lt;br /&gt;
    }&lt;br /&gt;
    @error;&lt;br /&gt;
    return &amp;quot;&amp;quot;;&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== General Use ==&lt;br /&gt;
&lt;br /&gt;
This version will work fine in [[LSO]] and [[Mono]] but not in LSLEditor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;//===================================================//&lt;br /&gt;
//                 Combined Library                  //&lt;br /&gt;
//             &amp;quot;Feb  4 2008&amp;quot;, &amp;quot;08:35:00&amp;quot;             //&lt;br /&gt;
//  Copyright (C) 2004-2008, Strife Onizuka (cc-by)  //&lt;br /&gt;
//    http://creativecommons.org/licenses/by/3.0/    //&lt;br /&gt;
//===================================================//&lt;br /&gt;
//{&lt;br /&gt;
&lt;br /&gt;
integer UTF8ToUnicodeInteger(string input)//LSLEditor Unsafe, LSO Safe&lt;br /&gt;
{&lt;br /&gt;
    integer result = llBase64ToInteger(llStringToBase64(input = llGetSubString(input,0,0)));&lt;br /&gt;
    if(result &amp;amp; 0x80000000)//multibyte, continuing to use base64 is impractical because it requires smart shifting.&lt;br /&gt;
        return  (   (  0x0000003f &amp;amp;  result       ) |&lt;br /&gt;
                    (( 0x00003f00 &amp;amp;  result) &amp;gt;&amp;gt; 2 ) | &lt;br /&gt;
                    (( 0x003f0000 &amp;amp;  result) &amp;gt;&amp;gt; 4 ) | &lt;br /&gt;
                    (( 0x3f000000 &amp;amp; (result = (integer)(&amp;quot;0x&amp;quot;+llGetSubString(input,-8,-1)))) &amp;gt;&amp;gt; 6 ) | &lt;br /&gt;
                    (( 0x0000003f &amp;amp;  result) &amp;lt;&amp;lt; 24) | &lt;br /&gt;
                    (( 0x00000100 &amp;amp; (result = (integer)(&amp;quot;0x&amp;quot;+llDeleteSubString(input = (string)llParseString2List(llEscapeURL(input),(list)&amp;quot;%&amp;quot;,[]),-8,-1)))) &amp;lt;&amp;lt; 22)&lt;br /&gt;
                ) &amp;amp; (  0x7FFFFFFF &amp;gt;&amp;gt; (5 * ((integer)(llLog(~result) / 0.69314718055994530941723212145818) - 25)));&lt;br /&gt;
//                    (( 0x00000100 &amp;amp; (result = (integer)(&amp;quot;0x&amp;quot;+llDeleteSubString(input,-8,-1)))) &amp;lt;&amp;lt; 22)&lt;br /&gt;
//                ) &amp;amp; (  0x7FFFFFFF &amp;gt;&amp;gt; (30 - (5 * (llStringLength(input = (string)llParseString2List(llEscapeURL(input),(list)&amp;quot;%&amp;quot;,[])) &amp;gt;&amp;gt; 1))));&lt;br /&gt;
    return result &amp;gt;&amp;gt; 24;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string UnicodeIntegerToUTF8(integer input)//LSLEditor Unsafe, LSO Safe&lt;br /&gt;
{&lt;br /&gt;
    integer bytes = llCeil((llLog(input) / 0.69314718055994530941723212145818));&lt;br /&gt;
    string result = &amp;quot;%&amp;quot; + byte2hex((input &amp;gt;&amp;gt; (6 * bytes)) | ((0x3F80 &amp;gt;&amp;gt; bytes) &amp;lt;&amp;lt; !(bytes = ((input &amp;gt;= 0x80) * (bytes + ~(((1 &amp;lt;&amp;lt; bytes) - input) &amp;gt; 0)) / 5))));&lt;br /&gt;
    while (bytes)&lt;br /&gt;
        result += &amp;quot;%&amp;quot; + byte2hex((((input &amp;gt;&amp;gt; (6 * (bytes = ~-bytes))) | 0x80) &amp;amp; 0xBF));&lt;br /&gt;
    return llUnescapeURL(result);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string byte2hex(integer x)//LSLEditor Safe, LSO Safe&lt;br /&gt;
{//Helper function for use with unicode characters.&lt;br /&gt;
    integer y = (x &amp;gt;&amp;gt; 4) &amp;amp; 0xF;&lt;br /&gt;
    return llGetSubString(hexc, y, y) + llGetSubString(hexc, x &amp;amp; 0xF, x &amp;amp; 0xF);&lt;br /&gt;
}//This function would benefit greatly from the DUP opcode, it would remove 19 bytes.&lt;br /&gt;
&lt;br /&gt;
string hexc=&amp;quot;0123456789ABCDEF&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
//} Combined Library&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==LSLEditor Safe==&lt;br /&gt;
&lt;br /&gt;
This version will work in [[Mono]], [[LSO]] &amp;amp; LSLEditor. There will be a slight performance hit in [[LSO]] as compared to the LSLEditor Unsafe version.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;//===================================================//&lt;br /&gt;
//                 Combined Library                  //&lt;br /&gt;
//             &amp;quot;Feb  4 2008&amp;quot;, &amp;quot;08:38:13&amp;quot;             //&lt;br /&gt;
//  Copyright (C) 2004-2008, Strife Onizuka (cc-by)  //&lt;br /&gt;
//    http://creativecommons.org/licenses/by/3.0/    //&lt;br /&gt;
//===================================================//&lt;br /&gt;
//{&lt;br /&gt;
&lt;br /&gt;
integer UTF8ToUnicodeInteger(string input)//LSLEditor Safe, LSO Safe&lt;br /&gt;
{&lt;br /&gt;
    integer result = llBase64ToInteger(llStringToBase64(input = llGetSubString(input,0,0)));&lt;br /&gt;
    if(result &amp;amp; 0x80000000){//multibyte, continuing to use base64 is impractical because it requires smart shifting.&lt;br /&gt;
        integer end = (integer)(&amp;quot;0x&amp;quot;+llGetSubString(input = (string)llParseString2List(llEscapeURL(input),(list)&amp;quot;%&amp;quot;,[]),-8,-1));&lt;br /&gt;
        integer begin = (integer)(&amp;quot;0x&amp;quot;+llDeleteSubString(input,-8,-1));&lt;br /&gt;
        return  (   (  0x0000003f &amp;amp;  end       ) |&lt;br /&gt;
                    (( 0x00003f00 &amp;amp;  end) &amp;gt;&amp;gt; 2 ) | &lt;br /&gt;
                    (( 0x003f0000 &amp;amp;  end) &amp;gt;&amp;gt; 4 ) | &lt;br /&gt;
                    (( 0x3f000000 &amp;amp;  end) &amp;gt;&amp;gt; 6 ) |&lt;br /&gt;
                    (( 0x0000003f &amp;amp;  begin) &amp;lt;&amp;lt; 24) |&lt;br /&gt;
                    (( 0x00000100 &amp;amp;  begin) &amp;lt;&amp;lt; 22)&lt;br /&gt;
                ) &amp;amp; (0x7FFFFFFF &amp;gt;&amp;gt; (5 * ((integer)(llLog(~result) / 0.69314718055994530941723212145818) - 25)));&lt;br /&gt;
    }&lt;br /&gt;
    return result &amp;gt;&amp;gt; 24;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string UnicodeIntegerToUTF8(integer input)//LSLEditor Safe, LSO Safe&lt;br /&gt;
{&lt;br /&gt;
    integer bytes = llCeil((llLog(input) / 0.69314718055994530941723212145818));&lt;br /&gt;
    bytes = (input &amp;gt;= 0x80) * (bytes + ~(((1 &amp;lt;&amp;lt; bytes) - input) &amp;gt; 0)) / 5;//adjust&lt;br /&gt;
    string result = &amp;quot;%&amp;quot; + byte2hex((input &amp;gt;&amp;gt; (6 * bytes)) | ((0x3F80 &amp;gt;&amp;gt; bytes) &amp;lt;&amp;lt; !bytes));&lt;br /&gt;
    while (bytes)&lt;br /&gt;
        result += &amp;quot;%&amp;quot; + byte2hex((((input &amp;gt;&amp;gt; (6 * (bytes = ~-bytes))) | 0x80) &amp;amp; 0xBF));&lt;br /&gt;
    return llUnescapeURL(result);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string byte2hex(integer x)//LSLEditor Safe, LSO Safe&lt;br /&gt;
{//Helper function for use with unicode characters.&lt;br /&gt;
    integer y = (x &amp;gt;&amp;gt; 4) &amp;amp; 0xF;&lt;br /&gt;
    return llGetSubString(hexc, y, y) + llGetSubString(hexc, x &amp;amp; 0xF, x &amp;amp; 0xF);&lt;br /&gt;
}//This function would benefit greatly from the DUP opcode, it would remove 19 bytes.&lt;br /&gt;
&lt;br /&gt;
string hexc=&amp;quot;0123456789ABCDEF&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
//} Combined Library&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=UTF-8&amp;diff=1193674</id>
		<title>UTF-8</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=UTF-8&amp;diff=1193674"/>
		<updated>2014-09-30T11:12:36Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: /* Limits under Mono */ Remove the almost meaningless word salad&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL Header}}{{LSLC|User-Defined_Functions}}&lt;br /&gt;
Second Life uses {{Wikipedia|UTF-8|UTF-8}} for storing and transmitting [[String|strings]] and with these functions you can work with {{Wikipedia|Unicode|Unicode}} characters. See: [[Unicode In 5 Minutes]] for a brief introduction to {{Wikipedia|Unicode|Unicode}}.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These functions are part of the [[Combined Library]] written by {{User|Strife Onizuka}}.&lt;br /&gt;
&lt;br /&gt;
== Limits under Mono ==&lt;br /&gt;
&lt;br /&gt;
Unicode predominately contains simple characters. For the vast majority of the range of values, Unicode values are simply characters. However some Unicode values do not represent any character and are not valid, which under Mono results in one or more question marks (&amp;quot;?&amp;quot;). UnicodeIntegerToUTF8 and UTF8ToUnicodeInteger work perfectly for the simple characters; however not so well for the other values. More on these ranges can be found in the [http://unicode.org Unicode] specification and [http://en.wikipedia.org/wiki/Specials_%28Unicode_block%29 Specials (Unicode block)]. While LSO doesn&#039;t care about these limitations, Mono does.&lt;br /&gt;
&lt;br /&gt;
These integer ranges are ranges where UTF8ToUnicodeInteger() and UnicodeIntegerToUTF8() are NOT inverse functions of each other under Mono.&lt;br /&gt;
Converting these integers to utf8 and back to integer may likely result in the integer 63 (the Unicode codepoint for &amp;quot;?&amp;quot;), no longer guaranteeing uniqueness:&lt;br /&gt;
&lt;br /&gt;
* [55296..57343] (2048 values). This corresponds to the surrogate area U+D800-U+DFFF, which is a reserved range because it&#039;s used by UTF-16 to represent the code points above U+FFFF.&lt;br /&gt;
* [65534] U+FFFE is in fact THE intentionally &amp;quot;INVALID CHARACTER&amp;quot; UTF-8 code point. It is invalid by design.&lt;br /&gt;
* [1114112 and above] can&#039;t be encoded because the Unicode range stops at U+10FFFF.&lt;br /&gt;
&lt;br /&gt;
== Standard ==&lt;br /&gt;
&lt;br /&gt;
This version of UnicodeIntegerToUTF8 complies to the latest standard. [[LSO]] on the other hand complies to an earlier standard. The newer standard includes only a subset of the older standard. The extended range of the old standard went unused so this incompleteness is moot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;string UnicodeIntegerToUTF8(integer input)//Mono Safe, LSLEditor Safe, LSO Incomplete&lt;br /&gt;
{//LSO allows for the older UTF-8 range, this function only supports the new UTF-16 range.&lt;br /&gt;
    if(input &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        if(input &amp;lt;= 0x7FF)&lt;br /&gt;
        {//instead of a flat if else chain, this redistributes the fork load so that only the 4 byte characters result in 3 forks, all the other paths are 2 forks.&lt;br /&gt;
            if(input &amp;lt;= 0x7F){&lt;br /&gt;
                input = input &amp;lt;&amp;lt; 24;&lt;br /&gt;
                jump quick_return;//saves us from the implicit double jump that using an else would cause.&lt;br /&gt;
            }&lt;br /&gt;
            input = 0xC0800000 | ((input &amp;lt;&amp;lt; 18) &amp;amp; 0x1F000000) | ((input &amp;lt;&amp;lt; 16) &amp;amp; 0x3F0000);&lt;br /&gt;
        }&lt;br /&gt;
        else if(input &amp;lt;= 0xFFFF)&lt;br /&gt;
            input = 0xE0808000 | ((input &amp;lt;&amp;lt; 12) &amp;amp; 0x0F000000) | ((input &amp;lt;&amp;lt; 10) &amp;amp; 0x3F0000) | ((input &amp;lt;&amp;lt; 8) &amp;amp; 0x3F00);&lt;br /&gt;
        else if(input &amp;lt;= 0x10FFFF)&lt;br /&gt;
            input = 0xF0808080 | ((input &amp;lt;&amp;lt; 06) &amp;amp; 0x07000000) | ((input &amp;lt;&amp;lt; 04) &amp;amp; 0x3F0000) | ((input &amp;lt;&amp;lt; 2) &amp;amp; 0x3F00) | (input &amp;amp; 0x3F);&lt;br /&gt;
        else&lt;br /&gt;
            jump error;//not in our range&lt;br /&gt;
        @quick_return;&lt;br /&gt;
        return llBase64ToString(llIntegerToBase64(input));&lt;br /&gt;
    }&lt;br /&gt;
    @error;&lt;br /&gt;
    return &amp;quot;&amp;quot;;&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== General Use ==&lt;br /&gt;
&lt;br /&gt;
This version will work fine in [[LSO]] and [[Mono]] but not in LSLEditor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;//===================================================//&lt;br /&gt;
//                 Combined Library                  //&lt;br /&gt;
//             &amp;quot;Feb  4 2008&amp;quot;, &amp;quot;08:35:00&amp;quot;             //&lt;br /&gt;
//  Copyright (C) 2004-2008, Strife Onizuka (cc-by)  //&lt;br /&gt;
//    http://creativecommons.org/licenses/by/3.0/    //&lt;br /&gt;
//===================================================//&lt;br /&gt;
//{&lt;br /&gt;
&lt;br /&gt;
integer UTF8ToUnicodeInteger(string input)//LSLEditor Unsafe, LSO Safe&lt;br /&gt;
{&lt;br /&gt;
    integer result = llBase64ToInteger(llStringToBase64(input = llGetSubString(input,0,0)));&lt;br /&gt;
    if(result &amp;amp; 0x80000000)//multibyte, continuing to use base64 is impractical because it requires smart shifting.&lt;br /&gt;
        return  (   (  0x0000003f &amp;amp;  result       ) |&lt;br /&gt;
                    (( 0x00003f00 &amp;amp;  result) &amp;gt;&amp;gt; 2 ) | &lt;br /&gt;
                    (( 0x003f0000 &amp;amp;  result) &amp;gt;&amp;gt; 4 ) | &lt;br /&gt;
                    (( 0x3f000000 &amp;amp; (result = (integer)(&amp;quot;0x&amp;quot;+llGetSubString(input,-8,-1)))) &amp;gt;&amp;gt; 6 ) | &lt;br /&gt;
                    (( 0x0000003f &amp;amp;  result) &amp;lt;&amp;lt; 24) | &lt;br /&gt;
                    (( 0x00000100 &amp;amp; (result = (integer)(&amp;quot;0x&amp;quot;+llDeleteSubString(input = (string)llParseString2List(llEscapeURL(input),(list)&amp;quot;%&amp;quot;,[]),-8,-1)))) &amp;lt;&amp;lt; 22)&lt;br /&gt;
                ) &amp;amp; (  0x7FFFFFFF &amp;gt;&amp;gt; (5 * ((integer)(llLog(~result) / 0.69314718055994530941723212145818) - 25)));&lt;br /&gt;
//                    (( 0x00000100 &amp;amp; (result = (integer)(&amp;quot;0x&amp;quot;+llDeleteSubString(input,-8,-1)))) &amp;lt;&amp;lt; 22)&lt;br /&gt;
//                ) &amp;amp; (  0x7FFFFFFF &amp;gt;&amp;gt; (30 - (5 * (llStringLength(input = (string)llParseString2List(llEscapeURL(input),(list)&amp;quot;%&amp;quot;,[])) &amp;gt;&amp;gt; 1))));&lt;br /&gt;
    return result &amp;gt;&amp;gt; 24;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string UnicodeIntegerToUTF8(integer input)//LSLEditor Unsafe, LSO Safe&lt;br /&gt;
{&lt;br /&gt;
    integer bytes = llCeil((llLog(input) / 0.69314718055994530941723212145818));&lt;br /&gt;
    string result = &amp;quot;%&amp;quot; + byte2hex((input &amp;gt;&amp;gt; (6 * bytes)) | ((0x3F80 &amp;gt;&amp;gt; bytes) &amp;lt;&amp;lt; !(bytes = ((input &amp;gt;= 0x80) * (bytes + ~(((1 &amp;lt;&amp;lt; bytes) - input) &amp;gt; 0)) / 5))));&lt;br /&gt;
    while (bytes)&lt;br /&gt;
        result += &amp;quot;%&amp;quot; + byte2hex((((input &amp;gt;&amp;gt; (6 * (bytes = ~-bytes))) | 0x80) &amp;amp; 0xBF));&lt;br /&gt;
    return llUnescapeURL(result);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string byte2hex(integer x)//LSLEditor Safe, LSO Safe&lt;br /&gt;
{//Helper function for use with unicode characters.&lt;br /&gt;
    integer y = (x &amp;gt;&amp;gt; 4) &amp;amp; 0xF;&lt;br /&gt;
    return llGetSubString(hexc, y, y) + llGetSubString(hexc, x &amp;amp; 0xF, x &amp;amp; 0xF);&lt;br /&gt;
}//This function would benefit greatly from the DUP opcode, it would remove 19 bytes.&lt;br /&gt;
&lt;br /&gt;
string hexc=&amp;quot;0123456789ABCDEF&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
//} Combined Library&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==LSLEditor Safe==&lt;br /&gt;
&lt;br /&gt;
This version will work in [[Mono]], [[LSO]] &amp;amp; LSLEditor. There will be a slight performance hit in [[LSO]] as compared to the LSLEditor Unsafe version.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;//===================================================//&lt;br /&gt;
//                 Combined Library                  //&lt;br /&gt;
//             &amp;quot;Feb  4 2008&amp;quot;, &amp;quot;08:38:13&amp;quot;             //&lt;br /&gt;
//  Copyright (C) 2004-2008, Strife Onizuka (cc-by)  //&lt;br /&gt;
//    http://creativecommons.org/licenses/by/3.0/    //&lt;br /&gt;
//===================================================//&lt;br /&gt;
//{&lt;br /&gt;
&lt;br /&gt;
integer UTF8ToUnicodeInteger(string input)//LSLEditor Safe, LSO Safe&lt;br /&gt;
{&lt;br /&gt;
    integer result = llBase64ToInteger(llStringToBase64(input = llGetSubString(input,0,0)));&lt;br /&gt;
    if(result &amp;amp; 0x80000000){//multibyte, continuing to use base64 is impractical because it requires smart shifting.&lt;br /&gt;
        integer end = (integer)(&amp;quot;0x&amp;quot;+llGetSubString(input = (string)llParseString2List(llEscapeURL(input),(list)&amp;quot;%&amp;quot;,[]),-8,-1));&lt;br /&gt;
        integer begin = (integer)(&amp;quot;0x&amp;quot;+llDeleteSubString(input,-8,-1));&lt;br /&gt;
        return  (   (  0x0000003f &amp;amp;  end       ) |&lt;br /&gt;
                    (( 0x00003f00 &amp;amp;  end) &amp;gt;&amp;gt; 2 ) | &lt;br /&gt;
                    (( 0x003f0000 &amp;amp;  end) &amp;gt;&amp;gt; 4 ) | &lt;br /&gt;
                    (( 0x3f000000 &amp;amp;  end) &amp;gt;&amp;gt; 6 ) |&lt;br /&gt;
                    (( 0x0000003f &amp;amp;  begin) &amp;lt;&amp;lt; 24) |&lt;br /&gt;
                    (( 0x00000100 &amp;amp;  begin) &amp;lt;&amp;lt; 22)&lt;br /&gt;
                ) &amp;amp; (0x7FFFFFFF &amp;gt;&amp;gt; (5 * ((integer)(llLog(~result) / 0.69314718055994530941723212145818) - 25)));&lt;br /&gt;
    }&lt;br /&gt;
    return result &amp;gt;&amp;gt; 24;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string UnicodeIntegerToUTF8(integer input)//LSLEditor Safe, LSO Safe&lt;br /&gt;
{&lt;br /&gt;
    integer bytes = llCeil((llLog(input) / 0.69314718055994530941723212145818));&lt;br /&gt;
    bytes = (input &amp;gt;= 0x80) * (bytes + ~(((1 &amp;lt;&amp;lt; bytes) - input) &amp;gt; 0)) / 5;//adjust&lt;br /&gt;
    string result = &amp;quot;%&amp;quot; + byte2hex((input &amp;gt;&amp;gt; (6 * bytes)) | ((0x3F80 &amp;gt;&amp;gt; bytes) &amp;lt;&amp;lt; !bytes));&lt;br /&gt;
    while (bytes)&lt;br /&gt;
        result += &amp;quot;%&amp;quot; + byte2hex((((input &amp;gt;&amp;gt; (6 * (bytes = ~-bytes))) | 0x80) &amp;amp; 0xBF));&lt;br /&gt;
    return llUnescapeURL(result);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string byte2hex(integer x)//LSLEditor Safe, LSO Safe&lt;br /&gt;
{//Helper function for use with unicode characters.&lt;br /&gt;
    integer y = (x &amp;gt;&amp;gt; 4) &amp;amp; 0xF;&lt;br /&gt;
    return llGetSubString(hexc, y, y) + llGetSubString(hexc, x &amp;amp; 0xF, x &amp;amp; 0xF);&lt;br /&gt;
}//This function would benefit greatly from the DUP opcode, it would remove 19 bytes.&lt;br /&gt;
&lt;br /&gt;
string hexc=&amp;quot;0123456789ABCDEF&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
//} Combined Library&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=UTF-8&amp;diff=1193673</id>
		<title>UTF-8</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=UTF-8&amp;diff=1193673"/>
		<updated>2014-09-30T10:57:00Z</updated>

		<summary type="html">&lt;p&gt;Pedro Oval: /* Limits */ Fix the mess a bit&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{LSL Header}}{{LSLC|User-Defined_Functions}}&lt;br /&gt;
Second Life uses {{Wikipedia|UTF-8|UTF-8}} for storing and transmitting [[String|strings]] and with these functions you can work with {{Wikipedia|Unicode|Unicode}} characters. See: [[Unicode In 5 Minutes]] for a brief introduction to {{Wikipedia|Unicode|Unicode}}.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These functions are part of the [[Combined Library]] written by {{User|Strife Onizuka}}.&lt;br /&gt;
&lt;br /&gt;
== Limits under Mono ==&lt;br /&gt;
&lt;br /&gt;
Unicode predominately contains simple characters. For the vast majority of the range of values, Unicode values are simply characters. However some Unicode values do not represent any character and are not valid, which under Mono results in one or more question marks (&amp;quot;?&amp;quot;). UnicodeIntegerToUTF8 and UTF8ToUnicodeInteger work perfectly for the simple characters; however not so well for the other values. More on these ranges can be found in the [http://unicode.org Unicode] specification and [http://en.wikipedia.org/wiki/Specials_%28Unicode_block%29 Specials (Unicode block)]. While LSO doesn&#039;t care about these limitations, Mono does.&lt;br /&gt;
&lt;br /&gt;
These integer ranges are ranges where UTF8ToUnicodeInteger() and UnicodeIntegerToUTF8() are NOT inverse functions of each other under Mono.&lt;br /&gt;
Converting these integers to utf8 and back to integer may likely result in the integer 63 (the Unicode codepoint for &amp;quot;?&amp;quot;), no longer guaranteeing uniqueness:&lt;br /&gt;
&lt;br /&gt;
* [55296..57343] (2048 values). This corresponds to the surrogate area U+D800-U+DFFF, which is a reserved range because it&#039;s used by UTF-16 to represent the code points above U+FFFF.&lt;br /&gt;
* [65534] U+FFFE is in fact THE intentionally &amp;quot;INVALID CHARACTER&amp;quot; UTF-8 code point. It is invalid by design.&lt;br /&gt;
* [1114112 and above] can&#039;t be encoded because the Unicode range stops at U+10FFFF.&lt;br /&gt;
&lt;br /&gt;
Some characters within ranges where the two functions are inverse functions of each other may still behave VERY STRANGE if more than 1 character is stored in a string (of multiple characters). They may ...&lt;br /&gt;
&lt;br /&gt;
* become double characters and mess up your indexing within a string. (this may even vary, depending on if a text field uses utf8 or utf16)&lt;br /&gt;
* merge with other characters into &amp;quot;super-mega-dino-mecha-character&amp;quot; (see &amp;quot;unicode combined characters&amp;quot;)&lt;br /&gt;
* are reserved characters (especially for JSON-like string serializations but also for simple things like &amp;quot;\n&amp;quot;)&lt;br /&gt;
* become invisible and may be skipped over by some functions (depending on compiler, VM, environment and programming language)&lt;br /&gt;
&lt;br /&gt;
Because of that you quickly get down to a range of 65504 unique SINGLE characters (still working in LSO in case you unchecked the &amp;quot;mono&amp;quot; button by accident) (&amp;lt;2^16 due to avoiding a lot of reserved and invalid characters) being able to store 2^15 bits per character in a string within lsl (for mono and LSO compiler). &lt;br /&gt;
&lt;br /&gt;
Storing 15 bits per character in a string quickly becomes more memory efficient than storing a list of 32-bit integers.&lt;br /&gt;
Each mono-integer taking 16 bytes to store 32 bit.&lt;br /&gt;
Each mono-character taking only 2 bytes to store 15 bit, + 18 taking bytes per string itself to store a string of characters.&lt;br /&gt;
&lt;br /&gt;
== Standard ==&lt;br /&gt;
&lt;br /&gt;
This version of UnicodeIntegerToUTF8 complies to the latest standard. [[LSO]] on the other hand complies to an earlier standard. The newer standard includes only a subset of the older standard. The extended range of the old standard went unused so this incompleteness is moot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;string UnicodeIntegerToUTF8(integer input)//Mono Safe, LSLEditor Safe, LSO Incomplete&lt;br /&gt;
{//LSO allows for the older UTF-8 range, this function only supports the new UTF-16 range.&lt;br /&gt;
    if(input &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        if(input &amp;lt;= 0x7FF)&lt;br /&gt;
        {//instead of a flat if else chain, this redistributes the fork load so that only the 4 byte characters result in 3 forks, all the other paths are 2 forks.&lt;br /&gt;
            if(input &amp;lt;= 0x7F){&lt;br /&gt;
                input = input &amp;lt;&amp;lt; 24;&lt;br /&gt;
                jump quick_return;//saves us from the implicit double jump that using an else would cause.&lt;br /&gt;
            }&lt;br /&gt;
            input = 0xC0800000 | ((input &amp;lt;&amp;lt; 18) &amp;amp; 0x1F000000) | ((input &amp;lt;&amp;lt; 16) &amp;amp; 0x3F0000);&lt;br /&gt;
        }&lt;br /&gt;
        else if(input &amp;lt;= 0xFFFF)&lt;br /&gt;
            input = 0xE0808000 | ((input &amp;lt;&amp;lt; 12) &amp;amp; 0x0F000000) | ((input &amp;lt;&amp;lt; 10) &amp;amp; 0x3F0000) | ((input &amp;lt;&amp;lt; 8) &amp;amp; 0x3F00);&lt;br /&gt;
        else if(input &amp;lt;= 0x10FFFF)&lt;br /&gt;
            input = 0xF0808080 | ((input &amp;lt;&amp;lt; 06) &amp;amp; 0x07000000) | ((input &amp;lt;&amp;lt; 04) &amp;amp; 0x3F0000) | ((input &amp;lt;&amp;lt; 2) &amp;amp; 0x3F00) | (input &amp;amp; 0x3F);&lt;br /&gt;
        else&lt;br /&gt;
            jump error;//not in our range&lt;br /&gt;
        @quick_return;&lt;br /&gt;
        return llBase64ToString(llIntegerToBase64(input));&lt;br /&gt;
    }&lt;br /&gt;
    @error;&lt;br /&gt;
    return &amp;quot;&amp;quot;;&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== General Use ==&lt;br /&gt;
&lt;br /&gt;
This version will work fine in [[LSO]] and [[Mono]] but not in LSLEditor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;//===================================================//&lt;br /&gt;
//                 Combined Library                  //&lt;br /&gt;
//             &amp;quot;Feb  4 2008&amp;quot;, &amp;quot;08:35:00&amp;quot;             //&lt;br /&gt;
//  Copyright (C) 2004-2008, Strife Onizuka (cc-by)  //&lt;br /&gt;
//    http://creativecommons.org/licenses/by/3.0/    //&lt;br /&gt;
//===================================================//&lt;br /&gt;
//{&lt;br /&gt;
&lt;br /&gt;
integer UTF8ToUnicodeInteger(string input)//LSLEditor Unsafe, LSO Safe&lt;br /&gt;
{&lt;br /&gt;
    integer result = llBase64ToInteger(llStringToBase64(input = llGetSubString(input,0,0)));&lt;br /&gt;
    if(result &amp;amp; 0x80000000)//multibyte, continuing to use base64 is impractical because it requires smart shifting.&lt;br /&gt;
        return  (   (  0x0000003f &amp;amp;  result       ) |&lt;br /&gt;
                    (( 0x00003f00 &amp;amp;  result) &amp;gt;&amp;gt; 2 ) | &lt;br /&gt;
                    (( 0x003f0000 &amp;amp;  result) &amp;gt;&amp;gt; 4 ) | &lt;br /&gt;
                    (( 0x3f000000 &amp;amp; (result = (integer)(&amp;quot;0x&amp;quot;+llGetSubString(input,-8,-1)))) &amp;gt;&amp;gt; 6 ) | &lt;br /&gt;
                    (( 0x0000003f &amp;amp;  result) &amp;lt;&amp;lt; 24) | &lt;br /&gt;
                    (( 0x00000100 &amp;amp; (result = (integer)(&amp;quot;0x&amp;quot;+llDeleteSubString(input = (string)llParseString2List(llEscapeURL(input),(list)&amp;quot;%&amp;quot;,[]),-8,-1)))) &amp;lt;&amp;lt; 22)&lt;br /&gt;
                ) &amp;amp; (  0x7FFFFFFF &amp;gt;&amp;gt; (5 * ((integer)(llLog(~result) / 0.69314718055994530941723212145818) - 25)));&lt;br /&gt;
//                    (( 0x00000100 &amp;amp; (result = (integer)(&amp;quot;0x&amp;quot;+llDeleteSubString(input,-8,-1)))) &amp;lt;&amp;lt; 22)&lt;br /&gt;
//                ) &amp;amp; (  0x7FFFFFFF &amp;gt;&amp;gt; (30 - (5 * (llStringLength(input = (string)llParseString2List(llEscapeURL(input),(list)&amp;quot;%&amp;quot;,[])) &amp;gt;&amp;gt; 1))));&lt;br /&gt;
    return result &amp;gt;&amp;gt; 24;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string UnicodeIntegerToUTF8(integer input)//LSLEditor Unsafe, LSO Safe&lt;br /&gt;
{&lt;br /&gt;
    integer bytes = llCeil((llLog(input) / 0.69314718055994530941723212145818));&lt;br /&gt;
    string result = &amp;quot;%&amp;quot; + byte2hex((input &amp;gt;&amp;gt; (6 * bytes)) | ((0x3F80 &amp;gt;&amp;gt; bytes) &amp;lt;&amp;lt; !(bytes = ((input &amp;gt;= 0x80) * (bytes + ~(((1 &amp;lt;&amp;lt; bytes) - input) &amp;gt; 0)) / 5))));&lt;br /&gt;
    while (bytes)&lt;br /&gt;
        result += &amp;quot;%&amp;quot; + byte2hex((((input &amp;gt;&amp;gt; (6 * (bytes = ~-bytes))) | 0x80) &amp;amp; 0xBF));&lt;br /&gt;
    return llUnescapeURL(result);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string byte2hex(integer x)//LSLEditor Safe, LSO Safe&lt;br /&gt;
{//Helper function for use with unicode characters.&lt;br /&gt;
    integer y = (x &amp;gt;&amp;gt; 4) &amp;amp; 0xF;&lt;br /&gt;
    return llGetSubString(hexc, y, y) + llGetSubString(hexc, x &amp;amp; 0xF, x &amp;amp; 0xF);&lt;br /&gt;
}//This function would benefit greatly from the DUP opcode, it would remove 19 bytes.&lt;br /&gt;
&lt;br /&gt;
string hexc=&amp;quot;0123456789ABCDEF&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
//} Combined Library&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==LSLEditor Safe==&lt;br /&gt;
&lt;br /&gt;
This version will work in [[Mono]], [[LSO]] &amp;amp; LSLEditor. There will be a slight performance hit in [[LSO]] as compared to the LSLEditor Unsafe version.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;lsl&amp;gt;//===================================================//&lt;br /&gt;
//                 Combined Library                  //&lt;br /&gt;
//             &amp;quot;Feb  4 2008&amp;quot;, &amp;quot;08:38:13&amp;quot;             //&lt;br /&gt;
//  Copyright (C) 2004-2008, Strife Onizuka (cc-by)  //&lt;br /&gt;
//    http://creativecommons.org/licenses/by/3.0/    //&lt;br /&gt;
//===================================================//&lt;br /&gt;
//{&lt;br /&gt;
&lt;br /&gt;
integer UTF8ToUnicodeInteger(string input)//LSLEditor Safe, LSO Safe&lt;br /&gt;
{&lt;br /&gt;
    integer result = llBase64ToInteger(llStringToBase64(input = llGetSubString(input,0,0)));&lt;br /&gt;
    if(result &amp;amp; 0x80000000){//multibyte, continuing to use base64 is impractical because it requires smart shifting.&lt;br /&gt;
        integer end = (integer)(&amp;quot;0x&amp;quot;+llGetSubString(input = (string)llParseString2List(llEscapeURL(input),(list)&amp;quot;%&amp;quot;,[]),-8,-1));&lt;br /&gt;
        integer begin = (integer)(&amp;quot;0x&amp;quot;+llDeleteSubString(input,-8,-1));&lt;br /&gt;
        return  (   (  0x0000003f &amp;amp;  end       ) |&lt;br /&gt;
                    (( 0x00003f00 &amp;amp;  end) &amp;gt;&amp;gt; 2 ) | &lt;br /&gt;
                    (( 0x003f0000 &amp;amp;  end) &amp;gt;&amp;gt; 4 ) | &lt;br /&gt;
                    (( 0x3f000000 &amp;amp;  end) &amp;gt;&amp;gt; 6 ) |&lt;br /&gt;
                    (( 0x0000003f &amp;amp;  begin) &amp;lt;&amp;lt; 24) |&lt;br /&gt;
                    (( 0x00000100 &amp;amp;  begin) &amp;lt;&amp;lt; 22)&lt;br /&gt;
                ) &amp;amp; (0x7FFFFFFF &amp;gt;&amp;gt; (5 * ((integer)(llLog(~result) / 0.69314718055994530941723212145818) - 25)));&lt;br /&gt;
    }&lt;br /&gt;
    return result &amp;gt;&amp;gt; 24;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string UnicodeIntegerToUTF8(integer input)//LSLEditor Safe, LSO Safe&lt;br /&gt;
{&lt;br /&gt;
    integer bytes = llCeil((llLog(input) / 0.69314718055994530941723212145818));&lt;br /&gt;
    bytes = (input &amp;gt;= 0x80) * (bytes + ~(((1 &amp;lt;&amp;lt; bytes) - input) &amp;gt; 0)) / 5;//adjust&lt;br /&gt;
    string result = &amp;quot;%&amp;quot; + byte2hex((input &amp;gt;&amp;gt; (6 * bytes)) | ((0x3F80 &amp;gt;&amp;gt; bytes) &amp;lt;&amp;lt; !bytes));&lt;br /&gt;
    while (bytes)&lt;br /&gt;
        result += &amp;quot;%&amp;quot; + byte2hex((((input &amp;gt;&amp;gt; (6 * (bytes = ~-bytes))) | 0x80) &amp;amp; 0xBF));&lt;br /&gt;
    return llUnescapeURL(result);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
string byte2hex(integer x)//LSLEditor Safe, LSO Safe&lt;br /&gt;
{//Helper function for use with unicode characters.&lt;br /&gt;
    integer y = (x &amp;gt;&amp;gt; 4) &amp;amp; 0xF;&lt;br /&gt;
    return llGetSubString(hexc, y, y) + llGetSubString(hexc, x &amp;amp; 0xF, x &amp;amp; 0xF);&lt;br /&gt;
}//This function would benefit greatly from the DUP opcode, it would remove 19 bytes.&lt;br /&gt;
&lt;br /&gt;
string hexc=&amp;quot;0123456789ABCDEF&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
//} Combined Library&amp;lt;/lsl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pedro Oval</name></author>
	</entry>
</feed>